On Mar 25, 2007, at 7:15 AM, Damien McCarthy wrote:

Mark,

Not using the standard implementation, as there may be times when a user
would wish to set a column to null.

As Jeff Butler explained a couple of days ago, there are two Spring DAO methods for performing an update. updateByPrimaryKey updates the columns corresponding to every field in the model object. updateByPrimaryKeySelective updates on the columns corresponding to non-null fields in the model object.
You can use the first method when you need to set columns to null.

-----Original Message-----
From: Mark Volkmann [mailto:[EMAIL PROTECTED]
Sent: 23 March 2007 19:31
To: user-java@ibatis.apache.org
Subject: DAO update with partial model objects

I'm using Spring DAOs generated by Abator. Is it the case that I can
pass a partially populated model object to a Spring DAO update method
and it will only update the corresponding columns that have non-null
values in my model object, leaving the other columns set to their
current value?


Reply via email to