ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CIJOML <cij...@volny.cz>
Subject Re: update person doesn't work?
Date Mon, 15 May 2006 10:00:17 GMT
Thank you :) It works :)

Michal

Dne pondělí 15 květen 2006 11:24 Niels Beekman napsal(a):
> Of course, you do nothing with the newAdministrator variable. You are
> just restoring the data that already exists. You should update using
> something like this:
>
> Administrator administrator = new Administrator();
> Administrator.setId(2);
> administrator.setJmeno("Ivan");
> sqlMap.update("updateAdministratorJmeno", administrator);
>
> Niels
>
> -----Original Message-----
> From: CIJOML [mailto:cijoml@volny.cz]
> Sent: maandag 15 mei 2006 11:00
> To: user-java@ibatis.apache.org
> Subject: update person doesn't work?
>
> Hello,
>
> My mapping is like:
>
>   <update id="updateAdministratorJmeno" parameterClass="Administrator">
>     UPDATE ADMINISTRATOR
>     SET JMENO = #jmeno#
>     WHERE ID_ADMINISTRATOR = #id#
>   </update>
>
> I call it like:
>
>            Administrator newAdministrator = new Administrator();
>            newAdministrator.setJmeno("Ivan");
>            sqlMap.update("updateAdministratorJmeno",
> (sqlMap.queryForObject("getAdministrator", new Integer(2))));
>
> This row is not updated, but when I call it via tora select * from
> administrator, I see this row at the end, so something was there
> changed.
>
> calling this manually from tora this works.
>
> Database is postgresql 8.1.3
>
> Calling insert/delete maps works for this class, I also doesn't get any
> exception for this - finishes without errors, but no update is made.
>
> Any clue?
>
> Thanks a lot
>
> Michal

Mime
View raw message