Re: JavaBean and Map parameters

2007-09-04 Thread Ilya Boyandin
hecking is an interesting idea - I'm just not sure that it makes it much less error prone - in both cases, you need to type (or paste) the names. It's not my idea, actually. I found it in the section "JavaBean and Map parameters" of "iBatis in Action". It sais: &q

Re: JavaBean and Map parameters

2007-09-03 Thread Larry Meadors
ing is an interesting idea - I'm just not sure that > > it makes it much less error prone - in both cases, you need to type > > (or paste) the names. > > > It's not my idea, actually. I found it in the section "JavaBean and Map > parameters" of "iBatis i

RE: JavaBean and Map parameters

2007-09-03 Thread Niels Beekman
maandag 3 september 2007 18:43 To: user-java@ibatis.apache.org Subject: Re: JavaBean and Map parameters Hi Larry, Larry Meadors wrote: > I don't know about the performance - a hashmap is pretty fast for > retrieval. (FYI: the constructor you use there will cause slower > performance

Re: JavaBean and Map parameters

2007-09-03 Thread Ilya Boyandin
eed to type (or paste) the names. It's not my idea, actually. I found it in the section "JavaBean and Map parameters" of "iBatis in Action". It sais: "If you create a parameter map with a bean and attempt to refer to a property that does not exist, you will get an

Re: JavaBean and Map parameters

2007-09-03 Thread Jiming Liu
I dont know how iBatis set the properties of a bean. In case it uses reflection, it surely will slower than hashmap. But if it uses the bean.set...(...) directly, i believe it is faster than hashmap. Jiming On 9/3/07, Larry Meadors <[EMAIL PROTECTED]> wrote: > > I don't know about the performan

Re: JavaBean and Map parameters

2007-09-03 Thread Larry Meadors
I don't know about the performance - a hashmap is pretty fast for retrieval. (FYI: the constructor you use there will cause slower performance - the default would use more memory, but be faster - using 3 or 4 as the parameter might be better, read the javadocs on that one.) The parameter checking

Re: JavaBean and Map parameters

2007-09-03 Thread Ilya Boyandin
Thanks, Larry! but could you tell me why? I thought using an anonymous class has an important advantage: it allows loading-time parameter check. Also I think it should be faster than using HashMap. Isn't it true? Ilya Larry Meadors wrote: Well, they should both do the same thing...I'd use

Re: JavaBean and Map parameters

2007-09-02 Thread Larry Meadors
Well, they should both do the same thing...I'd use the map. :) Larry On 8/31/07, Ilya Boyandin <[EMAIL PROTECTED]> wrote: > > Hello all, > > what should I prefer, this: > > return getSqlMapClientTemplate().queryForList("listEvaluationPlans", new > Object() { > long getPersonId() { return per

JavaBean and Map parameters

2007-08-31 Thread Ilya Boyandin
Hello all, what should I prefer, this: return getSqlMapClientTemplate().queryForList("listEvaluationPlans", new Object() { long getPersonId() { return personId; } String getLang() { return lang; } }); or this: final Map params = new HashMap(2); params.put("personId", personId); params