db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r280421 - /db/torque/templates/trunk/src/templates/om/Peer.vm
Date Mon, 12 Sep 2005 21:07:54 GMT
Author: tfischer
Date: Mon Sep 12 14:07:50 2005
New Revision: 280421

URL: http://svn.apache.org/viewcvs?rev=280421&view=rev
Log:
generates necessary addJoin statements in doSelectAllExceptXXXX()
solved issue with superfluous variable
Thanks to Thomas Vandahl for the patch

Modified:
    db/torque/templates/trunk/src/templates/om/Peer.vm

Modified: db/torque/templates/trunk/src/templates/om/Peer.vm
URL: http://svn.apache.org/viewcvs/db/torque/templates/trunk/src/templates/om/Peer.vm?rev=280421&r1=280420&r2=280421&view=diff
==============================================================================
--- db/torque/templates/trunk/src/templates/om/Peer.vm (original)
+++ db/torque/templates/trunk/src/templates/om/Peer.vm Mon Sep 12 14:07:50 2005
@@ -1332,10 +1332,18 @@
             #set ( $joinClassName = $joinTable.JavaName )
 
             #if (!$joinClassName.equals($excludeClassName))
-              #set ( $new_index = $index + 1 )
         ${joinClassName}Peer.addSelectColumns(criteria);
+              #set( $lfMap = $fk.LocalForeignMapping )
+              #foreach ($columnName in $fk.LocalColumns)
+                #set ( $column = $table.getColumn($columnName) )
+                #set ( $columnFk = $joinTable.getColumn( $lfMap.get($columnName) ) )
+        criteria.addJoin(${table.JavaName}Peer.$column.Name.toUpperCase(), ${joinClassName}Peer.$columnFk.Name.toUpperCase());
+              #end
+              #if($index < $table.ForeignKeys.size())
+                #set ( $new_index = $index + 1 )
         int offset$new_index = offset$index + ${joinClassName}Peer.numColumns;
-              #set ( $index = $new_index )
+                #set ( $index = $new_index )
+              #end
             #end
           #end
         #end



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