use of org.neo4j.ogm.session.delegates.LoadByTypeDelegate in project neo4j-ogm by neo4j.
the class StrictQueryingTest method shouldUseOnlyOneLabelForAllStandardEntities.
// GH-651
@Test
public void shouldUseOnlyOneLabelForAllStandardEntities() {
LoadByTypeDelegate delegate = new LoadByTypeDelegate(neo4jSession);
delegate.loadAll(SomeEntity.class);
ArgumentCaptor<GraphModelRequest> argumentCaptor = ArgumentCaptor.forClass(GraphModelRequest.class);
verify(request).execute(argumentCaptor.capture());
assertThat(argumentCaptor.getValue().getStatement()).isEqualTo("MATCH (n:`SomeEntity`) WITH n MATCH p=(n)-[*0..1]-(m) RETURN p");
}
use of org.neo4j.ogm.session.delegates.LoadByTypeDelegate in project neo4j-ogm by neo4j.
the class StrictQueryingTest method shouldUseOnlyOneLabelForAllRelationshipEntities.
// GH-651
@Test
public void shouldUseOnlyOneLabelForAllRelationshipEntities() {
LoadByTypeDelegate delegate = new LoadByTypeDelegate(neo4jSession);
delegate.loadAll(SomeRelationshipEntity.class);
ArgumentCaptor<GraphRowListModelRequest> argumentCaptor = ArgumentCaptor.forClass(GraphRowListModelRequest.class);
verify(request).execute(argumentCaptor.capture());
assertThat(argumentCaptor.getValue().getStatement()).startsWith("MATCH ()-[r0:`SOME_RELATIONSHIP`]-()");
}
use of org.neo4j.ogm.session.delegates.LoadByTypeDelegate in project neo4j-ogm by neo4j.
the class StrictQueryingTest method shouldUseAllLabelsForAllEntitiesInInheritanceScenario.
// GH-651
@Test
public void shouldUseAllLabelsForAllEntitiesInInheritanceScenario() {
LoadByTypeDelegate delegate = new LoadByTypeDelegate(neo4jSession);
delegate.loadAll(PersistentCategory.class);
ArgumentCaptor<GraphModelRequest> argumentCaptor = ArgumentCaptor.forClass(GraphModelRequest.class);
verify(request).execute(argumentCaptor.capture());
assertThat(argumentCaptor.getValue().getStatement()).isEqualTo("MATCH (n:`Category`:`Entity`) WITH n MATCH p=(n)-[*0..1]-(m) RETURN p");
}
Aggregations