@ Override public Object find ( Class entityClass , Object key ) { GraphDatabaseService graphDb = null ; if ( resource != null ) { graphDb = getConnection ( ) ; } if ( graphDb == null ) graphDb = factory . getConnection ( ) ; EntityMetadata m = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entityClass ) ; Object entity = null ; Node node = mapper . searchNode ( key , m , graphDb , true ) ; if ( node != null && ! ( ( Neo4JTransaction ) resource ) . containsNodeId ( node . getId ( ) ) ) { entity = getEntityWithAssociationFromNode ( m , node ) ; } return entity ; }
Finds an entity from graph database .