ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject RE: Safe to replace valueObject in RowHandler?
Date Wed, 30 Jan 2008 19:50:35 GMT
If it's an inner join, properly indexed, it shouldn't be too bad....


From: Hugh Ross [mailto:hh4ross@gmail.com] 
Sent: January-30-08 12:36 PM
To: user-java@ibatis.apache.org
Subject: Re: Safe to replace valueObject in RowHandler?



Yes, we have begun experimenting with discriminators and subMaps.  But, I
want to avoid a 15 table join...


On 1/30/08, Clinton Begin <clinton.begin@gmail.com> wrote: 

Unfortunately that's not possible in Java, let alone with iBATIS.  


If you're just trying to create subclasses based on a type column in the
database, look up "discriminator" in the ibatis documentation or mailing
list archives...




From: Hugh Ross [mailto:hh4ross@gmail.com] 
Sent: January-30-08 9:23 AM
To: user-java@ibatis.apache.org
Subject: Safe to replace valueObject in RowHandler?



Trying to be more specific:


Is it safe to create another object in the handleRow method, and set the
valueObject to it?


Is it safe to use queryForObject from within a handleRow method?  I've seen
other posts that imply it is.


Will that object then replace the original one, if it was created by a
queryForList or queryForObject call?  If I don't hear back, I guess I'll try
it to see...


On 1/29/08, Hugh Ross <hh4ross@gmail.com> wrote: 


I have the good fortune to work on a large domain model, part of which uses
too much inheritance.  I don't want to use a huge outer join with 15 or 20
tables in it.  I'm wondering if I can use RowHandlers to help.  In
particular, is it possible for a RowHandler to replace the object passed to
the handleRow method?




public void handleRow (Object valueObject)
   throws SQLException {
   Person person = (Person) valueObject;
   valueObject = MyFactory.createSubClassObject( person );


Any other sample solutions to this kind of problem are also most welcome...




View raw message