Hi Andras,

you are right, this is a possibility I did not think of. However (to excuse
my forgetfulness just a bit), there might be situtations where this is not
enough, e.g. if you you have a deeper tree of objects, or if you want to
load some dependencies instantly and lazy-load the others.

    Thomas

Andras Balogh <[EMAIL PROTECTED]> schrieb am 22.02.2005 17:09:18:

> Hello Thomas,
>
>     My understanding  is that if in the XML schema the foreign key
> relation is defined Torque
> will generate a protected method in BaseContactPeer
> doSelectCotactJoinByPhoneNumbers() (or something like that)
> So all that needs to be done is to make it public in ContactPeer.
>     This is not true any more? I know i have used this feature of Torque
> (3.0 and 3.1) several times.
>
>
> Best regards,
> Andras.
>
>
> Thomas Fischer wrote:
>
> >
> >
> >Hi,
> >
> >You can overwrite the doSelect Methods of your choice in ContactPeer to
> >access the PhoneNumbers. This automatically loads the phone numbers for
the
> >Contact. For example, in ContactPeer you could use
> >
> >public List doSelect(Criteria criteria, Connection connection) {
> >  List result = super.doSelect(criteria, connection);
> >  Iterator contactIt = result.iterator();
> >  while(contactIt.hasNext()) {
> >    Contact contact = (Contact) contactIt.next();
> >    contact.getPhoneNumbers(connection);
> >  }
> >  return result;
> >}
> >
> >Do not forget to overwrite the doSelect methods with other signatures if
> >you use them.
> >
> >   Thomas
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> 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