public static Relationship getRelationshipBetween ( final Node source , final Node target , final RelationshipType relationshipType , final Direction direction ) { for ( Relationship relationship : source . getRelationships ( relationshipType , direction ) ) { if ( relationship . getEndNode ( ) . equals ( target ) ) { return relationship ; } } return null ; }
Search for a relationship between two nodes