{
// given
final String name = "testCreateJoinCriteriaQuery";
final String nameOne = name + "-one";
final String nameMany = name + "-many";
Parent parent = new Parent(name);
parent.setOne(new OneToOne(nameOne));
parent.add(new OneToMany(nameMany));
entityManager.persist(parent);
entityManager.flush();
// when
List<Parent> result = parentRepo.joinQuery(name, nameOne, nameMany);
// then
assertEquals(1, result.size());
assertNotNull(result.get(0));
Parent queried = result.get(0);
assertEquals(name, queried.getName());
assertNotNull(queried.getOne());
assertEquals(nameOne, queried.getOne().getName());
assertEquals(1, queried.getMany().size());
assertEquals(nameMany, queried.getMany().get(0).getName());
}