openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r724856 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/ openjpa-slice/src/test/java/org/apache/openjpa/slice/
Date Tue, 09 Dec 2008 20:08:33 GMT
Author: ppoddar
Date: Tue Dec  9 12:08:32 2008
New Revision: 724856

URL: http://svn.apache.org/viewvc?rev=724856&view=rev
Log:
OPENJPA-801: PCPath is now a CandidatePath. But why was it not before?

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java
    openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestQuery.java

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=724856&r1=724855&r2=724856&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
Tue Dec  9 12:08:32 2008
@@ -37,6 +37,7 @@
 import org.apache.openjpa.jdbc.sql.SQLBuffer;
 import org.apache.openjpa.jdbc.sql.Select;
 import org.apache.openjpa.kernel.Filters;
+import org.apache.openjpa.kernel.exps.CandidatePath;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.FieldMetaData;
@@ -50,8 +51,11 @@
  * @author Abe White
  */
 public class PCPath
-    extends AbstractVal
+    extends CandidatePath
     implements JDBCPath {
+	
+    protected static final String TRUE = "1 = 1";
+    protected static final String FALSE = "1 <> 1";
 
     private static final int PATH = 0;
     private static final int BOUND_VAR = 1;
@@ -63,7 +67,6 @@
 
     private final ClassMapping _candidate;
     private ClassMapping _class = null;
-    private LinkedList _actions = null;
     private boolean _key = false;
     private int _type = PATH;
     private String _varName = null;
@@ -794,6 +797,11 @@
         return ObjectUtils.equals(_candidate, path._candidate)
             && ObjectUtils.equals(_actions, path._actions);
     }
+    
+    public int getId() {
+        return Val.VAL;
+    }
+
 
     /**
      * Helper class representing an action.

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java?rev=724856&r1=724855&r2=724856&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/CandidatePath.java
Tue Dec  9 12:08:32 2008
@@ -37,11 +37,11 @@
  *
  * @author Abe White
  */
-class CandidatePath
+public class CandidatePath
     extends Val
     implements Path {
 
-    private LinkedList _actions = null;
+    protected LinkedList _actions = null;
 
     /**
      * Traverse into the given field of the current object, and update

Modified: openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestQuery.java?rev=724856&r1=724855&r2=724856&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestQuery.java (original)
+++ openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestQuery.java Tue
Dec  9 12:08:32 2008
@@ -139,4 +139,12 @@
         }
         em.getTransaction().rollback();
     }
+    
+    public void testInMemoryOrderBy() {
+        EntityManager em = emf.createEntityManager();
+        em.getTransaction().begin();
+        Query query = em.createQuery("SELECT p FROM PObject p ORDER BY p.value");
+        List result = query.getResultList();
+        em.getTransaction().rollback();
+    }
 }



Mime
View raw message