use of org.neo4j.ogm.domain.gh851.Airport in project neo4j-ogm by neo4j.
the class QueryCapabilityTest method createFlights.
private void createFlights() {
// Create a few airports
Airport lhr = new Airport("LHR", "London Heathrow");
Airport lax = new Airport("LAX", "Los Angeles");
Airport cdg = new Airport("CDG", "Paris Charles de Gaulle");
// Create some flights
session.save(new Flight("FL 001", lhr, lax));
session.save(new Flight("FL 002", lhr, cdg));
session.save(new Flight("FL 003", lax, lhr));
}
use of org.neo4j.ogm.domain.gh851.Airport 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