openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r765469 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/ openjpa-persistence-jdbc/src/test/java/org/apache/openj...
Date Thu, 16 Apr 2009 05:34:51 GMT
Author: fancy
Date: Thu Apr 16 05:34:49 2009
New Revision: 765469

URL: http://svn.apache.org/viewvc?rev=765469&view=rev
Log:
1035 JPA2 Query map key path in predicates

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MapKey.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/Employee.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/PhoneNumber.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex2/TestMany2ManyMapEx2.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department1.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department2.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department3.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee1.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee2.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee3.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Department.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Employee.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Department.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Employee.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Department.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Employee.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex3/Company.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex4/Company.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex5/Company.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex6/Company.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex7/Company.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex8/Company.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex1/Company.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex3/TestSpec10_1_29_Ex3.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MapKey.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MapKey.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MapKey.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MapKey.java
Thu Apr 16 05:34:49 2009
@@ -62,18 +62,25 @@
 
     public void appendTo(Select sel, ExpContext ctx, ExpState state,
         SQLBuffer sql, int index) {
+        KeyExpState estate = (KeyExpState) state;
+        _key.appendTo(sel, ctx, estate.key, sql, index);
     }
 
     public void calculateValue(Select sel, ExpContext ctx, ExpState state,
         Val other, ExpState otherState) {
-        _key.calculateValue(sel, ctx, state, other, otherState);
+        KeyExpState estate = (KeyExpState) state;
+        _key.calculateValue(sel, ctx, estate.key, other, otherState);
     }
 
     public void groupBy(Select sel, ExpContext ctx, ExpState state) {
+        KeyExpState estate = (KeyExpState) state;
+        _key.groupBy(sel, ctx, estate.key);
     }
 
     public void orderBy(Select sel, ExpContext ctx, ExpState state,
         boolean asc) {
+        KeyExpState estate = (KeyExpState) state;
+        _key.orderBy(sel, ctx, estate.key, asc);
     }
 
     public ExpState initialize(Select sel, ExpContext ctx, int flags) {

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
Thu Apr 16 05:34:49 2009
@@ -82,6 +82,7 @@
     private Class _cast = null;
     private boolean _cid = false;
     private FieldMetaData _xmlfield = null;
+    private boolean _keyPath = false;
 
     /**
      * Return a path starting with the 'this' ptr.
@@ -274,7 +275,9 @@
      * The columns used by this path.
      */
     private Column[] calculateColumns(PathExpState pstate) {
-        if (_key) {
+        if (_key ||
+            (_keyPath && pstate.field.getKey() != null &&
+                !pstate.field.getKey().isEmbedded())) {
             if (!pstate.joinedRel 
                 && pstate.field.getKey().getValueMappedBy() != null)
                 joinRelation(pstate, _key, false, false);
@@ -499,6 +502,9 @@
                 // the key rather than value
                 key = action.op == Action.GET_KEY;
                 forceOuter |= action.op == Action.GET_OUTER;
+                
+                if (key && itr.hasNext())
+                    _keyPath = true;
 
                 // get mapping for the current field
                 pstate.field = field;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/Employee.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/Employee.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/Employee.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/Employee.java
Thu Apr 16 05:34:49 2009
@@ -23,7 +23,7 @@
 import java.util.*;
 
 @Entity
-@Table(name="MEx10Emp")
+@Table(name="M10Emp")
 public class Employee {
     @EmbeddedId
     EmployeePK empPK;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/PhoneNumber.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/PhoneNumber.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/PhoneNumber.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/PhoneNumber.java
Thu Apr 16 05:34:49 2009
@@ -23,7 +23,7 @@
 import java.util.*;
 
 @Entity
-@Table(name="MEx10Phone")
+@Table(name="M10Phone")
 public class PhoneNumber {
     @EmbeddedId
     PhonePK phonePK;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex2/TestMany2ManyMapEx2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex2/TestMany2ManyMapEx2.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex2/TestMany2ManyMapEx2.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex2/TestMany2ManyMapEx2.java
Thu Apr 16 05:34:49 2009
@@ -109,6 +109,14 @@
 
         assertTrue(d.equals(me.getKey()));
 
+        query = "select KEY(e) from PhoneNumber p, " +
+            " in (p.emps) e WHERE value(e).empId = 1 and KEY(e) = 'String1'";
+        q = em.createQuery(query);
+        if (inMemory) 
+            setCandidate(q, PhoneNumber.class);
+        rs = q.getResultList();
+        assertEquals((String) rs.get(0), "String1");
+
         em.close();
     }
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department1.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department1.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department1.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department1.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Dept1")
+@Table(name="T6D1")
 //@Access(AccessType.PROPERTY)
 public class Department1 {
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department2.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department2.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department2.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Dept2")
+@Table(name="T6D2")
 public class Department2 {
 
     int deptId;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department3.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department3.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department3.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Department3.java
Thu Apr 16 05:34:49 2009
@@ -29,7 +29,7 @@
 import javax.persistence.Table;
 
 @Entity
-@Table(name="S26Dept3")
+@Table(name="T6D3")
 public class Department3 {
 
     @Id

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee1.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee1.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee1.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee1.java
Thu Apr 16 05:34:49 2009
@@ -21,7 +21,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Emp1")
+@Table(name="T6E1")
 public class Employee1 {
     @Id
     int empId;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee2.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee2.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee2.java
Thu Apr 16 05:34:49 2009
@@ -23,7 +23,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Emp2")
+@Table(name="T6E2")
 public class Employee2 {
     EmployeePK2 empPK;
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee3.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee3.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee3.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex0/Employee3.java
Thu Apr 16 05:34:49 2009
@@ -21,7 +21,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Emp3")
+@Table(name="T6E3")
 public class Employee3 {
     @Id
     int empId;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Department.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Department.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Department.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Department.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Ex1Dept")
+@Table(name="S26x1Dept")
 public class Department {
     
     @Id

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Employee.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Employee.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Employee.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex1/Employee.java
Thu Apr 16 05:34:49 2009
@@ -21,7 +21,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Ex1Emp")
+@Table(name="S26x1Emp")
 public class Employee {
     @Id
     int empId;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Department.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Department.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Department.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Department.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Ex2Dept")
+@Table(name="S6Dept")
 public class Department {
 
     int deptId;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Employee.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Employee.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Employee.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex2/Employee.java
Thu Apr 16 05:34:49 2009
@@ -23,7 +23,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Ex2Emp")
+@Table(name="S6E2Emp")
 public class Employee {
     EmployeePK empPK;
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Department.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Department.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Department.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Department.java
Thu Apr 16 05:34:49 2009
@@ -29,7 +29,7 @@
 import javax.persistence.Table;
 
 @Entity
-@Table(name="S26Ex3Dept")
+@Table(name="A63Dept")
 public class Department {
 
     @Id

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Employee.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Employee.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Employee.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_26_ex3/Employee.java
Thu Apr 16 05:34:49 2009
@@ -21,7 +21,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S26Ex3Emp")
+@Table(name="A63Emp")
 public class Employee {
     @Id
     int empId;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex3/Company.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex3/Company.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex3/Company.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex3/Company.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S27x3Comp")
+@Table(name="S273Comp")
 public class Company {
     @Id
     int id;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex4/Company.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex4/Company.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex4/Company.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex4/Company.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S27x4Comp")
+@Table(name="S274Comp")
 public class Company {
     @Id
     int id;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex5/Company.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex5/Company.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex5/Company.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex5/Company.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S27x5Comp")
+@Table(name="S275Comp")
 public class Company {
     @Id
     int id;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex6/Company.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex6/Company.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex6/Company.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex6/Company.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S27x6Comp")
+@Table(name="S276Comp")
 public class Company {
     @Id
     int id;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex7/Company.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex7/Company.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex7/Company.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex7/Company.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S27x7Comp")
+@Table(name="S277Comp")
 public class Company {
     @Id
     int id;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex8/Company.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex8/Company.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex8/Company.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_27_ex8/Company.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="S27x8Comp")
+@Table(name="S278Comp")
 public class Company {
     @Id
     int id;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex1/Company.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex1/Company.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex1/Company.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex1/Company.java
Thu Apr 16 05:34:49 2009
@@ -24,7 +24,7 @@
 import javax.persistence.*;
 
 @Entity
-@Table(name="T29x1Comp")
+@Table(name="T291Comp")
 public class Company {
     @Id
     int id;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex3/TestSpec10_1_29_Ex3.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex3/TestSpec10_1_29_Ex3.java?rev=765469&r1=765468&r2=765469&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex3/TestSpec10_1_29_Ex3.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/spec_10_1_29_ex3/TestSpec10_1_29_Ex3.java
Thu Apr 16 05:34:49 2009
@@ -119,6 +119,14 @@
         assertTrue(c.equals(me.getKey()));
         assertEquals(s.getId(), ((Semester) me.getValue()).getId());
 
+        query = "select KEY(e) from Student s " +
+            " join s.enrollment e WHERE KEY(e).id = 1 order by s.id";
+        q = em.createQuery(query);
+        if (inMemory) 
+            setCandidate(q, Student.class);
+        rs = q.getResultList();
+        assertEquals(((Course) rs.get(0)).getId(), 1);
+
         em.close();
     }
 



Mime
View raw message