mirror of https://github.com/apache/openjpa.git
OPENJPA-547 add test strings for FETCH JOINs
git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.1.x@647026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b4fda6a917
commit
b3f919b1cc
|
@ -147,4 +147,34 @@ public class TestEJBJoins extends AbstractTestCase {
|
||||||
|
|
||||||
endEm(em);
|
endEm(em);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testInnerJoinFetch() {
|
||||||
|
EntityManager em = currentEntityManager();
|
||||||
|
|
||||||
|
String query = "SELECT s FROM Student " +
|
||||||
|
"s JOIN FETCH s.department";
|
||||||
|
|
||||||
|
List ls = (List) em.createQuery(query)
|
||||||
|
.getResultList();
|
||||||
|
|
||||||
|
assertNotNull(ls);
|
||||||
|
assertEquals(2, ls.size());
|
||||||
|
|
||||||
|
em.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testLeftJoinFetch() {
|
||||||
|
EntityManager em = currentEntityManager();
|
||||||
|
|
||||||
|
String query = "SELECT s FROM Student " +
|
||||||
|
"s LEFT JOIN FETCH s.department";
|
||||||
|
|
||||||
|
List ls = (List) em.createQuery(query)
|
||||||
|
.getResultList();
|
||||||
|
|
||||||
|
assertNotNull(ls);
|
||||||
|
assertEquals(4, ls.size());
|
||||||
|
|
||||||
|
em.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue