db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1369255 - in /db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates: dbObject/base/ peer/impl/base/
Date Sat, 04 Aug 2012 03:41:27 GMT
Author: tfischer
Date: Sat Aug  4 03:41:26 2012
New Revision: 1369255

URL: http://svn.apache.org/viewvc?rev=1369255&view=rev
Log:
Do not use deprecated criteria methods any more

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getterReferencingObject.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm
    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/fillReferencedObject.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/fillReferencingObjects.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/retrieveByPK.vm

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getterReferencingObject.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getterReferencingObject.vm?rev=1369255&r1=1369254&r2=1369255&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getterReferencingObject.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getterReferencingObject.vm
Sat Aug  4 03:41:26 2012
@@ -113,7 +113,7 @@
     #set ( $thisTableColumnElement = $referenceElement.getChild("foreign-column").getChild("column")
)
     #set ( $otherTablePeerColumnName = $otherTableColumnElement.getAttribute("peerColumnName")
)
     #set ( $thisTableColumnGetter = $thisTableColumnElement.getAttribute("getter") )
-                criteria.add(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}()
);
+                criteria.and(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}()
);
   #end
                 $field = ${otherTablePeerName}.doSelect(criteria);
             }
@@ -132,7 +132,7 @@
   #set ( $thisTableColumnElement = $referenceElement.getChild("foreign-column").getChild("column")
)
   #set ( $otherTablePeerColumnName = $otherTableColumnElement.getAttribute("peerColumnName")
)
   #set ( $thisTableColumnGetter = $thisTableColumnElement.getAttribute("getter") )
-                criteria.add(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}()
);
+                criteria.and(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}()
);
 #end
 #if ($objectIsCaching)
                 if (${criteriaCacheField} == null 
@@ -209,7 +209,7 @@
     #set ( $thisTableColumnElement = $referenceElement.getChild("foreign-column").getChild("column")
)
     #set ( $otherTablePeerColumnName = $otherTableColumnElement.getAttribute("peerColumnName")
)
     #set ( $thisTableColumnGetter = $thisTableColumnElement.getAttribute("getter") )
-                criteria.add(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}());
+                criteria.and(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}());
   #end
                 $field = ${otherTablePeerName}.doSelect(criteria, con);
             }
@@ -228,7 +228,7 @@
   #set ( $thisTableColumnElement = $referenceElement.getChild("foreign-column").getChild("column")
)
   #set ( $otherTablePeerColumnName = $otherTableColumnElement.getAttribute("peerColumnName")
)
   #set ( $thisTableColumnGetter = $thisTableColumnElement.getAttribute("getter") )
-                criteria.add(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}());
+                criteria.and(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}());
 #end
 #if ($objectIsCaching)
                 if (!${criteriaCacheField}.equals(criteria))

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm?rev=1369255&r1=1369254&r2=1369255&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/joinGetterReferencingObject.vm
Sat Aug  4 03:41:26 2012
@@ -80,7 +80,7 @@
   #set ( $thisTableColumnElement = $referenceElement.getChild("foreign-column").getChild("column")
)
   #set ( $otherTablePeerColumnName = $otherTableColumnElement.getAttribute("peerColumnName")
)
   #set ( $thisTableColumnGetter = $thisTableColumnElement.getAttribute("getter") )
-                criteria.add(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}()
);
+                criteria.and(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}()
);
 #end
                 $field = ${otherTablePeerName}.${peerJoinSelectMethod}(criteria, connection);
             }
@@ -95,7 +95,7 @@
   #set ( $thisTableColumnElement = $referenceElement.getChild("foreign-column").getChild("column")
)
   #set ( $otherTablePeerColumnName = $otherTableColumnElement.getAttribute("peerColumnName")
)
   #set ( $thisTableColumnGetter = $thisTableColumnElement.getAttribute("getter") )
-            criteria.add(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}()
);
+            criteria.and(${otherTablePeerName}.${otherTablePeerColumnName}, ${thisTableColumnGetter}()
);
 #end
             if (!${criteriaCacheField}.equals(criteria))
             {

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=1369255&r1=1369254&r2=1369255&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
Sat Aug  4 03:41:26 2012
@@ -75,7 +75,7 @@
     #set ( $i = 0 )
     #foreach ($primaryKeyColumnElement in $primaryKeyColumnElements)
       #set ( $peerColumnName = $primaryKeyColumnElement.getAttribute("peerColumnName"))
-                Criterion c$i = criteria.getNewCriterion(
+                Criterion c$i = new Criterion(
                     ${peerClassName}.$peerColumnName, keys[$i], Criteria.EQUAL);
       #set ( $j = $i - 1 )
       #if ($i > 0)

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=1369255&r1=1369254&r2=1369255&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
Sat Aug  4 03:41:26 2012
@@ -136,7 +136,7 @@
     #foreach ($referenceElement in $foreignKeyReferences)
     #set ( $columnElement = $referenceElement.getChild("foreign-column").getChild("column")
)
       #set ( $peerColumnName = $columnElement.getAttribute("peerColumnName"))
-                    Criterion c$i = criteria.getNewCriterion(
+                    Criterion c$i = new Criterion(
                         ${foreignTablePeerClassName}.${peerColumnName}, keys[$i], Criteria.EQUAL);
       #set ( $j = $i - 1 )
       #if ($i > 0)

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=1369255&r1=1369254&r2=1369255&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
Sat Aug  4 03:41:26 2012
@@ -146,7 +146,7 @@
   #foreach ($referenceElement in $foreignKeyReferences)
   #set ( $columnElement = $referenceElement.getChild("local-column").getChild("column") )
     #set ( $peerColumnName = $columnElement.getAttribute("peerColumnName"))
-                    Criterion c$i = criteria.getNewCriterion(
+                    Criterion c$i = new Criterion(
                         ${foreignTablePeerClassName}.${peerColumnName}, keys[$i], Criteria.EQUAL);
     #set ( $j = $i - 1 )
     #if ($i > 0)

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/retrieveByPK.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/retrieveByPK.vm?rev=1369255&r1=1369254&r2=1369255&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/retrieveByPK.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/retrieveByPK.vm
Sat Aug  4 03:41:26 2012
@@ -132,7 +132,7 @@
     #foreach ($columnElement in $primaryKeyColumnElements)
       #set ( $columnField = $columnElement.getAttribute("field") )
       #set ( $peerColumnName = $columnElement.getAttribute("peerColumnName") )
-        criteria.add(${peerClassName}.${peerColumnName}, $columnField);
+        criteria.and(${peerClassName}.${peerColumnName}, $columnField);
     #end
         List<${dbObjectClassName}> v = doSelect(criteria, con);
         if (v.size() == 1)



---------------------------------------------------------------------
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