public static Node getPrevSingleNode ( final Node user , RelationshipType relationshipType ) { // find an incoming relation of the type specified final Relationship rel = user . getSingleRelationship ( relationshipType , Direction . INCOMING ) ; return ( rel == null ) ? ( null ) : ( rel . getStartNode ( ) ) ; }
find an incoming relation from the user passed of the specified type