ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zeppelin <shantan...@gmail.com>
Subject Re: using java SortedSet instead of List for the resultMap
Date Thu, 04 Sep 2008 15:37:19 GMT

Thanks for that. I had previously read about RowHandler. Tell me if these are
correct :

1. Using the RowHandler, I would have to handle the cache myself and not
rely on iBATIS. Therefore, the 'cacheModel' attribute will be ignored. But
what I really wanted to use was the flushing mechanism.

2. Technically the caching in iBATIS is at application level. It is
described to be at session level since we can chage the way a user session
received an object -  a cloned object or a reference to the same object.

Just wanted to cofirm these. Also, it's a little strange that stored proc
out params cannot be cached.
Thanks again.
Zeppelin


Clinton Begin wrote:
> 
> You can pass in a RowHandler and have the results collect in whatever sort
> of collection you like.  The default implementation itself is a
> rowhandler,
> something (not exactly) like this:
> 
> public class ListRowHandler implements RowHandler {
>   private List list = new ArrayList();
> 
>   public void handleRow(Object valueObject) {
>     list.add(valueObject);
>   }
> 
>   public List getList() {
>     return list;
>   }
> }
> 
> Clinton
> 
> On Thu, Sep 4, 2008 at 8:41 AM, zeppelin <shantanu.u@gmail.com> wrote:
> 
>>
>> I have seen a similar question on this forum but it's not answered.
>>
>> My scenario :
>> * I'd like to use the iBATIS cache. It's working fine.
>> * My requirement is to use TreeSet cos I specifically want to use the
>> subset(...) method.
>>
>> It appears there's just no way in iBATIS to return a Set instead of a
>> List.
>> I can't understand why this feature is absent.
>>
>> Using the present approach, I have to pass the list to the TreeSet and
>> then
>> use it. This has to be done for ever user session that wants to access
>> the
>> cached entity.
>>
>> Is there any work around ? Is this supported in the spring framework ?
>> I'm
>> using org.springframework.orm.ibatis.support.SqlMapClientDaoSupport .
>>
>> regards
>>
>> Zeppelin
>> --
>> View this message in context:
>> http://www.nabble.com/using-java-SortedSet-instead-of-List-for-the-resultMap-tp19310126p19310126.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/using-java-SortedSet-instead-of-List-for-the-resultMap-tp19310126p19313314.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message