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:[EMAIL PROTECTED] 
Sent: maandag 15 mei 2006 11:00
To: [email protected]
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

Reply via email to