openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r443170 - in /incubator/openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-kernel/src/main/...
Date Thu, 14 Sep 2006 00:05:17 GMT
Author: awhite
Date: Wed Sep 13 17:05:16 2006
New Revision: 443170

URL: http://svn.apache.org/viewvc?view=rev&rev=443170
Log:
Query fixes.


Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java?view=diff&rev=443170&r1=443169&r2=443170
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
Wed Sep 13 17:05:16 2006
@@ -245,6 +245,13 @@
             : _class.getPrimaryKeyColumns();
     }
 
+    public boolean isVariable() {
+        if (_actions == null)
+            return false;
+        Action action = (Action) _actions.getLast();
+        return action.op == Action.UNBOUND_VAR || action.op == Action.VAR; 
+    }
+
     public void get(FieldMetaData field, boolean nullTraversal) {
         if (_actions == null)
             _actions = new LinkedList();

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java?view=diff&rev=443170&r1=443169&r2=443170
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
Wed Sep 13 17:05:16 2006
@@ -660,8 +660,8 @@
         ClassMapping mapping = repos.getMapping(cls, null, false);
         if (mapping != null)
             return mapping;
-        if (!validate || cls.isInterface() || 
-            repos.getPersistenceAware(cls) != null)
+        if (!validate || cls.isInterface() 
+            || repos.getPersistenceAware(cls) != null)
             return null;
         throw new MetaDataException(_loc.get("no-meta", cls));
     }

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java?view=diff&rev=443170&r1=443169&r2=443170
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
Wed Sep 13 17:05:16 2006
@@ -299,6 +299,10 @@
          * Throw proper exception if given value is a collection/map/array.
          */
         protected void assertNotContainer(Value val, StoreQuery q) {
+            // variables represent container elements, not the container itself
+            if (val.isVariable())
+                return;
+
             Class type;
             if (val instanceof Path) {
                 FieldMetaData fmd = ((Path) val).last();

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java?view=diff&rev=443170&r1=443169&r2=443170
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
Wed Sep 13 17:05:16 2006
@@ -1358,7 +1358,7 @@
         // determind how to evauate a variabe
         if (!val.isVariable())
             return val;
-        else if (handleVar == VAR_PATH)
+        else if (handleVar == VAR_PATH && !(val instanceof Path))
             return newPath(val, val.getMetaData());
         else if (handleVar == VAR_ERROR)
             throw parseException(EX_USER, "unexpected-var",

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?view=diff&rev=443170&r1=443169&r2=443170
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
Wed Sep 13 17:05:16 2006
@@ -92,11 +92,6 @@
     private static final Localizer _loc = Localizer.forPackage
         (MetaDataRepository.class);
 
-    // number of metadatas that have been registered thus far. This does not
-    // include dynamically-generated subclasses; it is just the count of
-    // user-created metadatas that were registered.
-    private int _count = 0;
-
     // system sequence
     private SequenceMetaData _sysSeq = null;
 
@@ -742,7 +737,6 @@
             if (_pawares.containsKey(cls))
                 throw new MetaDataException(_loc.get("pc-and-aware", cls));
             _metas.put(cls, meta);
-            _count++;
         }
         return meta;
     }
@@ -863,7 +857,6 @@
             Class impl = (Class) _ifaces.remove(cls);
             if (impl != null)
                 _metas.remove(impl);
-            _count--;
             return true;
         }
         return false;



Mime
View raw message