db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1364777 - in /db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base: buildCriteria.vm buildSelectCriteria.vm fillReferencedObject.vm fillReferencingObjects.vm
Date Mon, 23 Jul 2012 20:00:43 GMT
Author: tfischer
Date: Mon Jul 23 20:00:43 2012
New Revision: 1364777

URL: http://svn.apache.org/viewvc?rev=1364777&view=rev
Log:
Do not use deprecated Criteria methods in generated code

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildCriteria.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildSelectCriteria.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencedObject.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencingObjects.vm

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildCriteria.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildCriteria.vm?rev=1364777&r1=1364776&r2=1364777&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildCriteria.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildCriteria.vm
Mon Jul 23 20:00:43 2012
@@ -41,13 +41,13 @@
   #if ($primaryKeyColumnElements.size() == 1)
     #set ( $primaryKeyColumnElement = $primaryKeyColumnElements.get(0) )
     #set ( $peerColumnName = $primaryKeyColumnElement.getAttribute("peerColumnName") )
-        criteria.add(${peerClassName}.$peerColumnName, pk);
+        criteria.and(${peerClassName}.$peerColumnName, pk);
   #else
         SimpleKey[] keys = (SimpleKey[])pk.getValue();
     #set ( $i = 0 )
     #foreach ($primaryKeyColumnElement in $primaryKeyColumnElements)
       #set ( $peerColumnName = $primaryKeyColumnElement.getAttribute("peerColumnName") )
-        criteria.add(${peerClassName}.$peerColumnName, keys[$i]);
+        criteria.and(${peerClassName}.$peerColumnName, keys[$i]);
       #set ( $i = $i + 1 )
     #end
   #end
@@ -67,7 +67,7 @@
   #if ($primaryKeyColumnElements.size() == 1)
     #set ( $columnElement = $primaryKeyColumnElements.get(0) )
     #set ( $peerColumnName = $columnElement.getAttribute("peerColumnName"))
-        criteria.addIn(${peerClassName}.$peerColumnName, pks);
+        criteria.andIn(${peerClassName}.$peerColumnName, pks);
   #else
         for (ObjectKey pk : pks)
         {
@@ -132,10 +132,10 @@
   #if ($primaryKey && !$idMethod.equals("none"))
         if (!obj.isNew())
         {
-            criteria.add(${peerClassName}.$peerColumnName, obj.${getter}());
+            criteria.and(${peerClassName}.$peerColumnName, obj.${getter}());
         }
   #else
-        criteria.add(${peerClassName}.$peerColumnName, obj.${getter}());
+        criteria.and(${peerClassName}.$peerColumnName, obj.${getter}());
   #end
   #end
         return criteria;

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildSelectCriteria.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildSelectCriteria.vm?rev=1364777&r1=1364776&r2=1364777&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildSelectCriteria.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/buildSelectCriteria.vm
Mon Jul 23 20:00:43 2012
@@ -49,10 +49,10 @@
     #if ($primaryKey && !$idMethod.equals("none"))
         if (!obj.isNew())
         {
-            criteria.add(${peerClassName}.$peerColumnName, obj.${getter}());
+            criteria.and(${peerClassName}.$peerColumnName, obj.${getter}());
         }
     #else
-        criteria.add(${peerClassName}.$peerColumnName, obj.${getter}());
+        criteria.and(${peerClassName}.$peerColumnName, obj.${getter}());
     #end
   #end
 #end

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencedObject.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencedObject.vm?rev=1364777&r1=1364776&r2=1364777&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencedObject.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencedObject.vm
Mon Jul 23 20:00:43 2012
@@ -127,7 +127,7 @@
   #if ($foreignKeyReferences.size() == 1)
     #set ( $columnElement = $foreignKeyReferences.get(0).getChild("foreign-column").getChild("column")
)
     #set ( $peerColumnName = $columnElement.getAttribute("peerColumnName"))
-            criteria.addIn(${foreignTablePeerClassName}.${peerColumnName}, foreignKeyListChunk);
+            criteria.andIn(${foreignTablePeerClassName}.${peerColumnName}, foreignKeyListChunk);
   #else
             for (ObjectKey foreignKey : foreignKeyListChunk)
             {

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencingObjects.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencingObjects.vm?rev=1364777&r1=1364776&r2=1364777&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencingObjects.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencingObjects.vm
Mon Jul 23 20:00:43 2012
@@ -137,7 +137,7 @@
 #if ($foreignKeyReferences.size() == 1)
   #set ( $columnElement = $foreignKeyReferences.get(0).getChild("local-column").getChild("column")
)
   #set ( $peerColumnName = $columnElement.getAttribute("peerColumnName"))
-            criteria.addIn(${foreignTablePeerClassName}.${peerColumnName}, localKeyListChunk);
+            criteria.andIn(${foreignTablePeerClassName}.${peerColumnName}, localKeyListChunk);
 #else
             for (ObjectKey localKey : localKeyListChunk)
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message