mirror of https://github.com/apache/openjpa.git
OPENJPA-967 add query test strings for JPA2 path nagivation thru KEY appear in FROM, WHERE, and ORDER BY clause
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@756151 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6f253f050b
commit
ed0f74a34b
|
@ -71,11 +71,23 @@ public class TestMany2ManyMapEx4 extends SingleEMFTestCase {
|
|||
|
||||
public void testQueryQualifiedId() throws Exception {
|
||||
EntityManager em = emf.createEntityManager();
|
||||
// a collection valued path thru KEY in FROM clause
|
||||
String query1 = "select o.address.city from PhoneNumber p, " +
|
||||
" in (p.emps) e, in(KEY(e).offices) o";
|
||||
List rs1 = em.createQuery(query1).getResultList();
|
||||
" in (p.emps) e, in(KEY(e).offices) o";
|
||||
List rs1 = em.createQuery(query1).getResultList();
|
||||
|
||||
String query = "select KEY(e) from PhoneNumber p, " +
|
||||
// a path thru KEY nagivation apprear in ORDER BY
|
||||
query1 = "select o.address.city as city from PhoneNumber p, " +
|
||||
" in (p.emps) e, in(KEY(e).offices) o order by city";
|
||||
rs1 = em.createQuery(query1).getResultList();
|
||||
|
||||
// a path thru KEY nagivation apprear in WHERE clause
|
||||
query1 = "select o.address.city as city from PhoneNumber p, " +
|
||||
" in (p.emps) e, in(KEY(e).offices) o " +
|
||||
" where o.address.city like '%1'";
|
||||
rs1 = em.createQuery(query1).getResultList();
|
||||
|
||||
String query = "select KEY(e) from PhoneNumber p, " +
|
||||
" in (p.emps) e order by e.empId";
|
||||
List rs = em.createQuery(query).getResultList();
|
||||
Division d = (Division) rs.get(0);
|
||||
|
|
Loading…
Reference in New Issue