EntityManager em = emf.createEntityManager();
List<Department> ds =
em.createQuery("SELECT DISTINCT d FROM Department d LEFT JOIN FETCH d.employee2s " + "WHERE d.deptno = 10")
.getResultList();
System.out.println("-- testJPQLOneFetch -----");
em.clear();
Assert.assertEquals(1, ds.size());
for (Department x : ds) {
Assert.assertNull(x.getEmployees());
Assert.assertNotNull(x.getEmployee2s());
Assert.assertEquals(2, x.getEmployee2s().size());