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: IBator mapper calls all getters, not just the ones it needs
Date Wed, 21 Apr 2010 01:28:15 GMT
Its a bug in ibatis - not ibator. It was fixed a couple of days ago.
Recompile ibatis and you'll be good to go.

Jeff Butler


On 4/20/10, Morearty, Brian <Brian_Morearty@intuit.com> wrote:
> Hi,
>
>
>
> I'm using iBATIS 3 with a IBator 1.2.2.
>
>
>
> I used IBator to generate my models in Eclipse. Then I added some more
> functions to the code-generated classes, taking advantage of the nifty
> feature where it doesn't clobber my changes.
>
>
>
> I've just discovered that when I call insertSelective(), it seems that
> all public getters in my model are called-regardless of whether they're
> needed for the insert. This is bad since some of the getters do
> lazy-evaluation and may slow things down.
>
>
>
> Is this by design, or perhaps (fingers-crossed) a known bug that has
> been fixed since I compiled IBator 1.2.2 a month and a half ago?
>
>
>
> I found the culprit in DynamicContext.java. It calls all the getters,
> regardless of whether they will be needed:
>
>
>
>   public DynamicContext(Configuration configuration, Object
> parameterObject) {
>
>     if (parameterObject != null && !(parameterObject instanceof Map)) {
>
>       MetaObject metaObject =
> configuration.newMetaObject(parameterObject);
>
>       String[] names = metaObject.getGetterNames();
>
>       for (String name : names) {
>
>         bindings.put(name, metaObject.getValue(name));
>
>       }
>
>     }
>
>     bindings.put(PARAMETER_OBJECT_KEY, parameterObject);
>
>   }
>
>
>
>
>
> Any chance there's a quick fix for this?
>
>
>
> Thanks!
>
>
>
> Brian Morearty | Grow Your Business Division, Intuit | Staff Software
> Engineer | direct 650-944-6852
>
>
>
>

-- 
Sent from my mobile device

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message