@Test
public void should_create_fetch_query()
{
// given
final String name = "testCreateFetchQuery";
Parent parent = new Parent(name);
parent.add(new OneToMany(name + "-1"));
parent.add(new OneToMany(name + "-2"));
entityManager.persist(parent);
entityManager.flush();
// when
Parent result = parentRepo.fetchQuery(name);
// then
assertNotNull(result);
assertEquals(name, result.getName());
assertNotNull(result.getMany());
assertEquals(2, result.getMany().size());
}