ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Update on a list of POJOs -- what's the best approach?
Date Tue, 28 Dec 2004 18:44:11 GMT
Hi Karen,

> Is my best bet in writing the statement itself, to pass the list in as the
> parameter and then iterate over it to build a WHERE clause that uses IN ()? 

Yes, for sure.

> Also, I haven't seen one, but is there a way to pass multiple 
> parameters to a statement? 

No, not through an additional method parameter.  You can pass multiple
parameters as Map entries or JavaBeans properties (the latter is
preferred, but a few more lines of code).

Clinton


On Tue, 28 Dec 2004 11:51:46 -0600, Karen Koch <kmkoch@sbcglobal.net> wrote:
>  
>  
> 
> I'm not quite certain how this problem is best approached using SQLMaps: 
> 
>   
> 
> I want to implement a sort of "mass update" feature by which the database
> records that correspond to objects in a java.util.List have 3 fields set. 
> All objects in the list will have the 3 fields set to the same 3 values. 
> 
>   
> 
> Is my best bet in writing the statement itself, to pass the list in as the
> parameter and then iterate over it to build a WHERE clause that uses IN ()? 
> 
>   
> 
> Also, I haven't seen one, but is there a way to pass multiple parameters to
> a statement?  Ideally, I want to pass the list itself and also a single
> integer that will be used to update one of the three fields and look up the
> values to update the other two fields.

Mime
View raw message