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: using java SortedSet instead of List for the resultMap
Date Thu, 04 Sep 2008 14:48:45 GMT
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.
>
>

Mime
View raw message