db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Working with BasePeer extensions
Date Tue, 10 Feb 2009 08:28:55 GMT
I'll check this in the next few days. If there are direct references to 
base peer these should be removed if possible.
I'd second also the idea to separate between static wrapper and instance 
for peers in 4.0

          Thomas

Greg Monroe <monroe@dukece.com> schrieb am 09.02.2009 16:22:19:
> IMHO, it makes sense that if we supply a way to replace the default 
BasePeer
> with your own class, that the templates should honor that replacement. 
> Otherwise as Tal said, you can't override the static methods in the 
default
> class.
> 
> If that is the case, I wonder if the BasePeer code shouldn't be 
refactored
> to have BasePeer and BasePeerInstance classes, similar to the Torque and
> TorqueInstance pair.  This would allow for static methods to be built on 

> easily override-able instance methods. E.g. BasePeer.doSelect(...) would
> do a getBasePeerInstance().doSelect(...) call.
> 
> To allow for custom BasePeerInstance classes, we'd probably need to move 

> the class def from the generator properties to the runtime properties. 
Then
> have the Torque init process populate the BasePeerInstance singleton 
with
> the custom class in the properties.
> 
> On the plus side, the templates would not have to be re-done and all 
> existing code that makes BasePeer callse would automatically pick up 
> a custome BasePeerInstance.
> 
> A candidate for 4.0 work?
> 
> > -----Original Message-----
> > From: Thomas Vandahl [mailto:tv@apache.org]
> > Sent: Sunday, February 08, 2009 9:50 AM
> > To: Apache Torque Developers List
> > Subject: Re: Working with BasePeer extensions
> > 
> > Tal Kramer wrote:
> > >    3.1 Wherever there was a direct reference to "BasePeer" in 
Peer.jm,
> > > it was replaced by "${table.BasePeer}", e.g.
> > >            return BasePeer.doInsert(criteria, con); >> return
> > > ${table.BasePeer}.doInsert(criteria, con);
> > 
> > This kind of bothers me. Are you positive that these replacements were
> > necessary? If so, that would mean to me that the use of direct 
BasePeer
> > calls must be considered a bug in the templates. Opinions?
> > 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message