You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Lurtz Ugluk <lu...@yahoo.es> on 2005/06/22 13:12:47 UTC
Update with two beans
Hi,
how can I do an update with two parameter beans and
without a resultmap??
Something like this:
Hashtable hm = new Hashtable();
hm.put("setBean", setBeanObject);
hm.put("whereBean", whereBeanObject);
sqlMap.update("update", hm);
And in the xml?? I'm putting this, but I have errors
<!-- Statement Update de base de datos-->
<statement id="updateME"
parameterClass="java.util.Hashtable">
UPDATE table
SET valueSet = <isEqual property="value"
compareProperty="key" compareValue="setBean">
#value.newValue# </isEqual>
WHERE id = <isEqual property="value"
compareProperty="key" compareValue="whereBean">
#value.whereValue# </isEqual>
</statement>
Is correct? Any other ways?
Thanks.
______________________________________________
Renovamos el Correo Yahoo!
Nuevos servicios, más seguridad
http://correo.yahoo.es
Re: Update with two beans
Posted by Clinton Begin <cl...@gmail.com>.
I have no idea what you're doing, but it looks like it should "work"
(whatever it is...). ;-)
Cheers,
Clinton
On 6/22/05, Lurtz Ugluk <lu...@yahoo.es> wrote:
>
> Hi,
>
> how can I do an update with two parameter beans and
> without a resultmap??
> Something like this:
>
> Hashtable hm = new Hashtable();
>
> hm.put("setBean", setBeanObject);
>
> hm.put("whereBean", whereBeanObject);
>
> sqlMap.update("update", hm);
>
> And in the xml?? I'm putting this, but I have errors
>
> <!-- Statement Update de base de datos-->
>
> <statement id="updateME"
> parameterClass="java.util.Hashtable">
>
> UPDATE table
>
> SET valueSet = <isEqual property="value"
> compareProperty="key" compareValue="setBean">
> #value.newValue# </isEqual>
>
> WHERE id = <isEqual property="value"
> compareProperty="key" compareValue="whereBean">
> #value.whereValue# </isEqual>
>
> </statement>
>
>
>
> Is correct? Any other ways?
>
> Thanks.
>
>
>
>
>
>
>
> ______________________________________________
> Renovamos el Correo Yahoo!
> Nuevos servicios, más seguridad
> http://correo.yahoo.es
>