I try to load an entire object (with its hierarchy) with this code:
final Filter filter = new Filter (this.identity.name(),ComparisonOperator.EQUALS, identity);
filter.setRelationshipDirection(Relationship.OUTGOING);
final Filters filters = new Filters (filter);
final Collection<T> values = ogmSession.loadAll(this.classType,filters , -1);
if (values != null){
rvalue = values.iterator().next();
}
But the generated query is (with performance issue):
BoltRequest - Request: MATCH (n:`Procedure`) WHERE n.`name` = { `name_0` } WITH n MATCH p=(n)-[*0..]-(m) RETURN p, ID(n) with params {name_0=WMS-1-B}
Instead of something like that (with relationship direction in last MATCH clause):
MATCH (n:`Procedure`) WHERE n.`name` = { `name_0` } WITH n MATCH p=(n)-[*0..]->(m) RETURN p, ID(n) with params {name_0=WMS-1-B}
Did I miss something or is it a bug ? Thanks.
Querying Neo4j 3.2 CE with the following dependencies:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
</parent>
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-core</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-bolt-driver</artifactId>
<version>2.1.3</version>
</dependency>
(n)-->(m)and(n)<--(m). - Bruno Peres(:Procedure)-[:ROUTE_TO]->(:Task)-->(:Sink)<--(:Task)and(:Procedure)<-[:IS_PART_OF]-(:Task)- SylvainRoussy