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/trunk@647026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
810e401dbe
commit
07cd1728a1
|
@ -147,4 +147,34 @@ public class TestEJBJoins extends AbstractTestCase {
|
|||
|
||||
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