use of org.neo4j.ogm.session.LoadStrategy in project neo4j-ogm by neo4j.
the class QueryCapabilityTest method bothLoadStrategiesShouldBeAbleToDealWithPaths.
@Test
public void bothLoadStrategiesShouldBeAbleToDealWithPaths() {
for (LoadStrategy strategy : new LoadStrategy[] { LoadStrategy.PATH_LOAD_STRATEGY, LoadStrategy.SCHEMA_LOAD_STRATEGY }) {
SessionFactory localSessionFactory = new SessionFactory(getDriver(), "org.neo4j.ogm.domain.gh851");
localSessionFactory.setLoadStrategy(strategy);
Session session = localSessionFactory.openSession();
Filter f = new Filter("code", ComparisonOperator.EQUALS, "LAX");
Collection<Airport> airports = session.loadAll(Airport.class, f);
assertThat(airports).hasSize(1).first().extracting(Airport::getName).isEqualTo("Los Angeles");
session.clear();
// Keep the local session factory open, otherwise closing it will mess up the driver.
}
}
Aggregations