use of org.neo4j.ogm.domain.cineasts.annotated.ExtendedUser in project neo4j-ogm by neo4j.
the class LookupByPrimaryIndexTests method loadUsesPrimaryIndexWhenPresentOnSuperclass.
@Test
public void loadUsesPrimaryIndexWhenPresentOnSuperclass() {
ExtendedUser user1 = new ExtendedUser("login2", "Name 2", "password");
session.save(user1);
final Session session2 = sessionFactory.openSession();
final User retrievedUser1 = session2.load(ExtendedUser.class, "login2");
assertThat(retrievedUser1).isNotNull();
assertThat(retrievedUser1.getLogin()).isEqualTo(user1.getLogin());
}
use of org.neo4j.ogm.domain.cineasts.annotated.ExtendedUser in project neo4j-ogm by neo4j.
the class QueryCapabilityTest method testQueryWithProjection.
// GH-496
@Test
public void testQueryWithProjection() {
Assume.assumeFalse(isHttpDriver());
Iterable<User> results = session.query(User.class, "MATCH (u:User) where u.name=$name return u " + ",[[(u)-[r:EXTENDED_FRIEND]->(e) | [r, e ] ] ] ", Collections.singletonMap("name", "Vince"));
assertThat(results).size().isEqualTo(1);
User user = results.iterator().next();
assertThat(user.getName()).isEqualTo("Vince");
assertThat(user.getExtendedFriends()).isNotEmpty();
assertThat(user.getExtendedFriends()).contains(new ExtendedUser(null, "extended", null));
}
Aggregations