>Eric J Altman wrote
> Rafal Krzewski wrote:
> > I'm wondering how other Turbiners deal with it right now.
> > I edited my generated classes by hand adding the additional functionality.
> > I changed Peer classes also, to deal with object relationships (my BO is
> > compound and thus represented by multiple tables. I wanted it to retrieve
> > all data with single call to MasterObjectPeer.doSelect() and delete all data
> > with single call to MasterObjectPeer.doDelete()).
> > I had to edit the code by hand anyway because Torque smashed the case or my
> > table/colum names :-(.
>
> I do something similar I think (although not with torque yet). I
> slightly modified Jon's original code generator class to build the
> compound object/peer classes based on the foreign keys declared in the
> sql create table statements. Then just added a boolean parameter to
> doSelect to get back a vector of objects backed by multiple tables, plus
> some methods to the generated objects to more lazily instantiate the
> child objects if required. I don't know if this is a particularly good
> practice (seems half way between peers and what used to be OPaL), but I
> find it a convenient abstraction. Anyway, I still have to edit the Peer
> class as others have described to return an extended generated object,
> so +1 from this non-committer on the proposed change.
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. I found that my "lazy instantiate" tended to be a *lot* slower that a join
in the peer. Could you may elaborate on what you've done, please. Maybe send me
some source-code by private e-mail.
I'm truly sorry that I haven't uploaded my template base Torque yet - It is
finished and I've been trying since Friday, but ran into one brick wall after
another :-( Will do soon, promise!
~ Leon
> 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]