use of org.neo4j.ogm.domain.gh368.User in project mybatis-issues by harawata.
the class ConfPropWithSpringTest method shouldInsertAUser.
@Test
public void shouldInsertAUser() {
User user = new User();
user.setId(2);
user.setName("User2");
mapper.insertUser(user);
}
use of org.neo4j.ogm.domain.gh368.User in project neo4j-ogm by neo4j.
the class DeepNestQueryingOfRelationshipEntitiesIntegrationTest method flattenedPathSegmentsShouldWorkFromBothEnds.
@Test
public void flattenedPathSegmentsShouldWorkFromBothEnds() {
Filter outgoing = new Filter("name", ComparisonOperator.EQUALS, "U1");
outgoing.setOwnerEntityType(GroupMember.class);
outgoing.setNestedPath(new Filter.NestedPathSegment("user", User.class));
Filter incoming = new Filter("name", ComparisonOperator.EQUALS, "EuregJUG");
incoming.setOwnerEntityType(GroupMember.class);
incoming.setNestedPath(new Filter.NestedPathSegment("group", UserGroup.class));
Collection<GroupMember> members = sessionFactory.openSession().loadAll(GroupMember.class, outgoing.and(incoming));
assertThat(members).hasSize(1);
}
use of org.neo4j.ogm.domain.gh368.User in project neo4j-ogm by neo4j.
the class DeepNestQueryingOfRelationshipEntitiesIntegrationTest method createData.
@Before
public void createData() {
sessionFactory.openSession().purgeDatabase();
Address a1 = new Address();
a1.setCode("0001");
Address a2 = new Address();
a2.setCode("0002");
City aachen = new City("Aachen");
City koeln = new City("Köln");
a2.setCity(aachen);
User u1 = new User("U1");
u1.setAddress(a1);
User u2 = new User("Mr. User");
u2.setAddress(a1);
User u3 = new User();
u3.setAddress(a2);
UserGroup ug1 = new UserGroup();
ug1.setCity(aachen);
ug1.setName("EuregJUG");
UserGroup ug2 = new UserGroup();
ug2.setCity(koeln);
ug2.setName("JUG Köln");
List<GroupMember> members = Arrays.asList(new GroupMember(u1, ug1), new GroupMember(u2, ug2), new GroupMember(u3, ug2));
Session session = sessionFactory.openSession();
members.forEach(session::save);
}
use of org.neo4j.ogm.domain.gh368.User in project neo4j-ogm by neo4j.
the class DeepNestQueryingOfRelationshipEntitiesIntegrationTest method nPlus1PathSegmentsShouldWork.
@Test
public void nPlus1PathSegmentsShouldWork() {
Filter filter = new Filter("name", ComparisonOperator.EQUALS, "Aachen");
filter.setOwnerEntityType(GroupMember.class);
filter.setNestedPath(new Filter.NestedPathSegment("user", User.class), new Filter.NestedPathSegment("address", Address.class), new Filter.NestedPathSegment("city", City.class));
Collection<GroupMember> members = sessionFactory.openSession().loadAll(GroupMember.class, filter);
assertThat(members).hasSize(1);
}
use of org.neo4j.ogm.domain.gh368.User in project neo4j-ogm by neo4j.
the class DeepNestQueryingOfRelationshipEntitiesIntegrationTest method nPathSegmentsShouldWorkFromBothEnds.
@Test
public void nPathSegmentsShouldWorkFromBothEnds() {
Filter outgoing = new Filter("code", ComparisonOperator.EQUALS, "0001");
outgoing.setOwnerEntityType(GroupMember.class);
outgoing.setNestedPath(new Filter.NestedPathSegment("user", User.class), new Filter.NestedPathSegment("address", Address.class));
Filter incoming = new Filter("name", ComparisonOperator.EQUALS, "Aachen");
incoming.setOwnerEntityType(GroupMember.class);
incoming.setNestedPath(new Filter.NestedPathSegment("group", UserGroup.class), new Filter.NestedPathSegment("city", City.class));
Collection<GroupMember> members = sessionFactory.openSession().loadAll(GroupMember.class, outgoing.and(incoming));
assertThat(members).hasSize(1);
}
Aggregations