The reason the checks are there is that in normal Peer operation the
columns are added by the Peer.  But making the check allows the method
to also be used to select an arbitrary set of columns.
So for example you could do a SELECT count(*) FROM ...

In this case you do not want the Peer to add additional columns.

The code should be in both places, I will fix as I am going to make
another change to these templates.

Thanks, 
john mcnally


"Henning P. Schmiedehausen" wrote:
> 
> Hi,
> 
> if I generate a BaseMyTablePeer with torque, I get
> 
> --- cut ---
> public static Vector doSelectVillageRecords( Criteria criteria )
>   throws Exception
> {
>   criteria.setDbName(mapBuilder.getDatabaseMap().getName());
>   if (criteria.getSelectColumns().size() == 0)
>   {
>     addSelectColumns ( criteria );
>   }
>   return BasePeer.doSelect(criteria);
> }
> --- cut ---
> 
> but
> 
> --- cut ---
> public static Vector doSelectVillageRecords( Criteria criteria,
>                                                DBConnection dbCon )
>   throws Exception
> {
>   addSelectColumns ( criteria );
>   return BasePeer.doSelect(criteria, dbCon);
> }
> --- cut ---
> 
> Is there a reason that the first method tests on the number of already
> existing select columns in the Criteria and the second does not?
> 
> Is it necessary at all, because in my understanding, adding a column
> twice changes nothing at all.
> 
>         Regards
>                 Henning
> 
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
> INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     [EMAIL PROTECTED]
> 
> Am Schwabachgrund 22  Fon.: 09131 / 50654-0   [EMAIL PROTECTED]
> D-91054 Buckenhof     Fax.: 09131 / 50654-20
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to