use of org.neo4j.ogm.domain.cineasts.annotated.User 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