RE: TypeHandlerCallback and lazy loading

2005-05-31 Thread Niels Beekman
I use the typehandlers to retrieve other classes that are not managed by 
iBATIS, but to pass columnvalues transparently, so I do not have to store all 
kinds of int's in my classes but declare the properties directly of the 
appriopriate type.

I don't know which data has to be retrieved at forehand, so it is rather 
pointless to fetch my whole DB, just in case someone requests that data :)

Niels

From: Clinton Begin [mailto:[EMAIL PROTECTED] 
Sent: dinsdag 31 mei 2005 17:48
To: ibatis-user-java@incubator.apache.org
Subject: Re: TypeHandlerCallback and lazy loading

Lazy loading won't reduce the number of queries, unless you're never accessing 
the data you're retrieving, in which case I'd ask why you're loading it at all.

Consider joining the data and mapping it with groupBy="" and a nested 
resultMap.  This faq might help

http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+get+around+the+N+Plus+1+selects+problem%3F
 

Cheers,
Clinton
On 5/31/05, Niels Beekman <[EMAIL PROTECTED]> wrote:
Hi,

I've successfully used TypeHandlerCallback to load some complex
datatypes. Now I'm facing the following problem: I have a resultmap
which has 5 typehandler-definitions, when I load an object using this
resultmap, the typehandlers are called instantly, which cause lots of
DB-queries to be executed.

Is there a way to enable lazy loading for typehandlers? Maybe to keep
the ResultGetter in cache and only execute a special construction-method 
when the property is requested?

Thanks for your thoughts,

Niels



Re: TypeHandlerCallback and lazy loading

2005-05-31 Thread Clinton Begin
Lazy loading won't reduce the number of queries, unless you're never
accessing the data you're retrieving, in which case I'd ask why you're
loading it at all.

Consider joining the data and mapping it with groupBy="" and a nested resultMap.  This faq might help

http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+get+around+the+N+Plus+1+selects+problem%3F


Cheers,
ClintonOn 5/31/05, Niels Beekman <[EMAIL PROTECTED]> wrote:
Hi,I've successfully used TypeHandlerCallback to load some complexdatatypes. Now I'm facing the following problem: I have a resultmapwhich has 5 typehandler-definitions, when I load an object using this
resultmap, the typehandlers are called instantly, which cause lots ofDB-queries to be executed.Is there a way to enable lazy loading for typehandlers? Maybe to keepthe ResultGetter in cache and only execute a special construction-method
when the property is requested?Thanks for your thoughts,Niels