Examples of RelationshipType


Examples of org.chromattic.api.RelationshipType

        if (beanElementType instanceof BeanValueInfo) {
          BeanValueInfo bvi = (BeanValueInfo)beanElementType;

          //
          OneToManyMapping mapping;
          RelationshipType type = oneToManyAnn.type();
          if (type == RelationshipType.HIERARCHIC) {
            MappedBy mappedBy = propertyInfo.getAnnotation(MappedBy.class);
            if (mappedBy != null) {
              throw new IllegalStateException();
            }
            mapping = new OneToManyMapping(bvi.getTypeInfo(), RelationshipType.HIERARCHIC);
          } else {
            RelatedMappedBy mappedBy = propertyInfo.getAnnotation(RelatedMappedBy.class);
            if (mappedBy == null) {
              throw new IllegalStateException();
            }
            mapping = new NamedOneToManyMapping(bvi.getTypeInfo(), mappedBy.value(), type);
          }

          //
          PropertyMapping<OneToManyMapping> oneToManyMapping = new PropertyMapping<OneToManyMapping>(propertyInfo, mapping);
          propertyMappings.add(oneToManyMapping);
        }
      }
    }

    // Many to one
    for (PropertyInfo propertyInfo : info.getProperties(ManyToOne.class)) {
      if (propertyInfo instanceof SingleValuedPropertyInfo) {
        SingleValuedPropertyInfo svpi = (SingleValuedPropertyInfo)propertyInfo;
        ValueInfo vi = svpi.getValue();
        if (vi instanceof BeanValueInfo) {
          BeanValueInfo bvi = (BeanValueInfo)vi;

          //
          ManyToOne manyToOneAnn = propertyInfo.getAnnotation(ManyToOne.class);
          RelationshipType type = manyToOneAnn.type();

          //
          if (type == RelationshipType.HIERARCHIC) {
            RelationshipMapping hierarchyMapping = new ManyToOneMapping(bvi.getTypeInfo(), RelationshipType.HIERARCHIC);
            PropertyMapping<RelationshipMapping> manyToOneMapping = new PropertyMapping<RelationshipMapping>(propertyInfo, hierarchyMapping);
View Full Code Here

Examples of org.dozer.classmap.RelationshipType

    if (StringUtils.isNotEmpty(getAttribute(ele, BEAN_FACTORY))) {
      definitionBuilder.beanFactory(getAttribute(ele, BEAN_FACTORY));
    }
    if (StringUtils.isNotEmpty(getAttribute(ele, RELATIONSHIP_TYPE))) {
      String relationshipTypeValue = getAttribute(ele, RELATIONSHIP_TYPE);
      RelationshipType relationshipType = RelationshipType.valueOf(relationshipTypeValue);
      definitionBuilder.relationshipType(relationshipType);
    }
    if (StringUtils.isNotEmpty(getAttribute(ele, WILDCARD))) {
      definitionBuilder.wildcard(Boolean.valueOf(getAttribute(ele, WILDCARD)));
    }
View Full Code Here

Examples of org.dozer.classmap.RelationshipType

      }
    }
  }

  private void setRelationshipType(Element ele, DozerBuilder.FieldMappingBuilder definitionBuilder) {
    RelationshipType relationshipType = null;
    if (StringUtils.isNotEmpty(getAttribute(ele, RELATIONSHIP_TYPE))) {
      String relationshipTypeValue = getAttribute(ele, RELATIONSHIP_TYPE);
      relationshipType = RelationshipType.valueOf(relationshipTypeValue);
    }
    definitionBuilder.relationshipType(relationshipType);
View Full Code Here

Examples of org.dozer.classmap.RelationshipType

        } else if (WILDCARD.equals(element.getNodeName())) {
          configBuilder.wildcard(Boolean.valueOf(nodeValue));
        } else if (TRIM_STRINGS.equals(element.getNodeName())) {
          configBuilder.trimStrings(Boolean.valueOf(nodeValue));
        } else if (RELATIONSHIP_TYPE.equals(element.getNodeName())) {
          RelationshipType relationshipType = RelationshipType.valueOf(nodeValue);
          configBuilder.relationshipType(relationshipType);
        } else if (BEAN_FACTORY.equals(element.getNodeName())) {
          configBuilder.beanFactory(nodeValue);
        } else if (CUSTOM_CONVERTERS_ELEMENT.equals(element.getNodeName())) {
          parseCustomConverters(element, configBuilder);
View Full Code Here

Examples of org.neo4j.graphdb.RelationshipType

        long nextRel = nodeRecord.getNextRel();
        List<BatchRelationship> rels = new ArrayList<BatchRelationship>();
        while ( nextRel != Record.NO_NEXT_RELATIONSHIP.intValue() )
        {
            RelationshipRecord relRecord = getRelationshipRecord( nextRel );
            RelationshipType type = new RelationshipTypeImpl(
                    typeHolder.getName( relRecord.getType() ) );
            rels.add( new BatchRelationship( relRecord.getId(),
                    relRecord.getFirstNode(), relRecord.getSecondNode(), type ) );
            long firstNode = relRecord.getFirstNode();
            long secondNode = relRecord.getSecondNode();
View Full Code Here

Examples of org.neo4j.graphdb.RelationshipType

        long nextRel = nodeRecord.getNextRel();
        List<SimpleRelationship> rels = new ArrayList<SimpleRelationship>();
        while ( nextRel != Record.NO_NEXT_RELATIONSHIP.intValue() )
        {
            RelationshipRecord relRecord = getRelationshipRecord( nextRel );
            RelationshipType type = new RelationshipTypeImpl(
                    typeHolder.getName( relRecord.getType() ) );
            rels.add( new SimpleRelationship( relRecord.getId(),
                    relRecord.getFirstNode(), relRecord.getSecondNode(), type ) );
            long firstNode = relRecord.getFirstNode();
            long secondNode = relRecord.getSecondNode();
View Full Code Here

Examples of org.neo4j.graphdb.RelationshipType

    @Override
    public BatchRelationship getRelationshipById( long relId )
    {
        RelationshipRecord record = getRelationshipRecord( relId );
        RelationshipType type = new RelationshipTypeImpl(
                typeHolder.getName( record.getType() ) );
        return new BatchRelationship( record.getId(), record.getFirstNode(),
                record.getSecondNode(), type );
    }
View Full Code Here

Examples of org.neo4j.graphdb.RelationshipType

    }

    public SimpleRelationship getSimpleRelationshipById( long relId )
    {
        RelationshipRecord record = getRelationshipRecord( relId );
        RelationshipType type = new RelationshipTypeImpl(
                typeHolder.getName( record.getType() ) );
        return new SimpleRelationship( record.getId(), record.getFirstNode(),
                record.getSecondNode(), type );
    }
View Full Code Here

Examples of org.neo4j.graphdb.RelationshipType

  private Relationship deleteTempNodeAndUpdateRelationshipWithEntity(AssociationKey associationKey, RowKey rowKey, Node rowKeyNode) {
    Node ownerNode = neo4jCRUD.findNode( associationKey.getEntityKey(), ENTITY );
    Relationship inverseRelationship = updateInverseRelationship( rowKey, rowKeyNode, ownerNode );

    RelationshipType associationType = relationshipType( associationKey );
    Relationship relationship = null;
    if ( !associationKey.getCollectionRole().equals( associationKey.getTable() ) ) {
      relationship = ownerNode.createRelationshipTo( inverseRelationship.getStartNode(), associationType );
      applyColumnValues( rowKey, relationship );
    }
View Full Code Here

Examples of org.neo4j.graphdb.RelationshipType

    }
  }

  private static Node getNodeByName(DatabaseService db, String name) {
    Node typeSubRef = getOrCreateTypeSubRef(db);
    RelationshipType relType = DynamicRelationshipType.withName(name);
    if (typeSubRef.hasRelationship(relType, Direction.OUTGOING)) {
      return typeSubRef
          .getSingleRelationship(relType, Direction.OUTGOING)
          .getEndNode();
    } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.