Cool. Thanks.
-----Original Message----- From: Jeff Butler [mailto:jeffgbut...@gmail.com] Sent: Tuesday, April 20, 2010 6:28 PM To: user-java@ibatis.apache.org Subject: Re: IBator mapper calls all getters, not just the ones it needs 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_morea...@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-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org