ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Result Map Extends/
Date Mon, 27 Feb 2006 18:16:50 GMT
My guess is that the problem is that LazyDynaBean does not implement
java.util.Map, but sort of acts like a Map.  iBATIS has special code to deal
with Maps because the properties cannot be discovered with regular
reflection methods.

I'd suggest that the best way to deal with this is to create some sort of an
adapter class - a class that implements java.util.Map, but delegates to a
LazyDynaBean.  Either that or do one of the other methods you already
described.

Jeff Butler



On 2/27/06, Ben Munat <bent@munat.com> wrote:
>
> I don't think Alden was asking for a dependency... I think he was just
> trying to use
> LazyDynaBean as the resultClass in his sqlMap and it's not working. I
> would imagine that
> has something to do with a clash between the reflection used by
> LazyDynaBean and the
> relection used by SqlMap.
>
> Alden, what error are you getting?
>
> b
>
> Sven Boden wrote:
> >
> > It don't think it will be included. The idea is to have an absolute
> > minimal amount of dependencies on other software.
> >
> > Regards,
> > Sven
> >
> > Alden S wrote:
> >
> >> Hi,
> >>
> >> I want to use org.apache.commons.beanutils.LazyDynaBean for the
> >> resultClass but Ibatis does not allow me to.
> >>
> >> <select id="getBatParReport2"  parameterClass="java.lang.String"
> >> resultClass="org.apache.commons.beanutils.LazyDynaBean">
> >>
> >> I know i can use HashMap and then do
> >>   org.apache.commons.beanutils.BeanUtils.copyProperties(bean, map);
> >> which would be acceptable for queryForObject(..........)
> >>
> >> but if you do queryForList or queryForMap, then you have to write code
> >> to iterate over the map or coolection and do
> >> org.apache.commons.beanutils.BeanUtils.copyProperties(bean, map);
> >> which is a nuisance and redundant to copy the data from one object to
> >> another.
> >> I use LazyBean or DynaBean bc i use trhem all over as java beans, also
> >> for when i used the <display:table tag.
> >>
> >> Does ibatis provide this, or will it ever or never provide this.
> >>
> >> Thanks
> >>
> >> Alden.
> >>
> >>
> >>
> >
>

Mime
View raw message