ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Boyandin <Ilya.Boyan...@fh-joanneum.at>
Subject Re: JavaBean and Map parameters
Date Mon, 03 Sep 2007 08:13:14 GMT

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 the map. :)
>
> Larry
>
>
> On 8/31/07, Ilya Boyandin <Ilya.Boyandin@fh-joanneum.at> wrote:
>   
>> 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<String, Object> params = new HashMap<String, Object>(2);
>> params.put("personId", personId);
>> params.put("lang", lang);
>> return getSqlMapClientTemplate().queryForList("listEvaluationPlans",
>> params);
>>
>> Thanks in advance
>> Ilya
>>     



FH JOANNEUM Gesellschaft mbH
Rechtsform/Legal form: GmbH
Firmenbuchgericht/Court of registry: Landesgericht für ZRS Graz
Firmenbuchnummer/Company registration: FN 125888 f
DVR: 0813559
UID-Nr.: ATU 42361001

Mime
View raw message