You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2005/09/12 23:07:54 UTC

svn commit: r280421 - /db/torque/templates/trunk/src/templates/om/Peer.vm

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