Hello Leon,
Leon Messerschmidt wrote:
>
> I was also looking at doing doSelect() from multiple tables and got it working
> well enough. Basically what I've done is to create a new method - something like
> ProductPeer.doSelectWithVendor() that created a join between the two tables and
> called Product.setVendor for each row.
>
> I was thinking in making this easier with Torque, but I'd like to see what you've
> done.
It would be great to have this sort of functionality in torque. I just
do what you describe above though: use a join in the select statement to
create a main business object and component objects for each row. I
find it convenient to auto-generate the "doSelectWithVendor()" type
classes since my db map already specifies the appropriate db foreign
keys to use for the sql join.
> I found that my "lazy instantiate" tended to be a *lot* slower that a join
> in the peer.
Perhaps I used the term incorrectly. I like having the option of either
returning a vector of the compound business objects with all the
sub-components already set, or returning a vector of business objects
backed by only one table, like the usual doSelect(). The latter objects
would have their
components set only if necessary. I'd be hesitant to do a lot of work
on this stuff: it's convenient to use, but nobody wants a poor
rewrite of what castor or opal (can't think of the new name) do well.
I look forward to seeing what you've been up to with torque, it sounds
very promising!
Regards
Eric J Altman
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]