Package org.neo4j.graphdb

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


        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

    @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

    }

    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

  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

    }
  }

  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

    }
  }

  public static Node getOrCreateByDescriptor(TypeNodeDescriptor tnd) {
    Node typeSubRef = getOrCreateTypeSubRef(tnd.db);
    RelationshipType relType = DynamicRelationshipType.withName(tnd.name);
    Node foundNode = getNodeByName(tnd.db, tnd.name);
    if (foundNode != null) {
      if (tnd.claz.getName().equals(foundNode.getProperty(CLASS_NAME))) {
        return foundNode;
      } else {
View Full Code Here

        .getId());
  }

  private static Node getOrCreateTypeSubRef(DatabaseService db) {
        Node refNode = ReferenceNodes.getReferenceNode(db);
    RelationshipType relType = RelTypes.ORG_NEO4J_COLLECTIONS_GRAPHDB_TYPE_SUBREF;
    if (refNode.hasRelationship(relType, Direction.OUTGOING)) {
      return refNode.getSingleRelationship(relType, Direction.OUTGOING)
          .getEndNode();
    } else {
      Node n = db.createNode();
View Full Code Here

    }

    @Override
    public NamedAssociationState namedAssociationValueOf( QualifiedName stateName )
    {
        RelationshipType namedAssociation = namedAssociation( stateName );
        Relationship rel = underlyingNode.getSingleRelationship( namedAssociation, Direction.OUTGOING );
        if( rel != null )
        {
            return new NeoNamedAssociationState( uow, this, rel.getEndNode() );
        }
View Full Code Here

    }
   
    @Override
    public ManyAssociationState manyAssociationValueOf( QualifiedName stateName )
    {
        RelationshipType manyAssociation = manyAssociation( stateName );
        Relationship rel = underlyingNode.getSingleRelationship( manyAssociation, Direction.OUTGOING );
        if( rel != null )
        {
            return new NeoManyAssociationState( uow, this, rel.getEndNode() );
        }
View Full Code Here

TOP

Related Classes of org.neo4j.graphdb.RelationshipType

Copyright © 2018 www.massapicom. 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.