Hi,
I am having problem with saveOrUpdate. (ONly when doing an Update)
I create a database object.
Account a = new Account();
where Account is a table with 10 columns, out of which 2 keys form the composite primary key.
I set values for 5 columns like...
(assume Name and ID form composite Keys)
a.setName("aaa");
a.setId("12");
......
after that I call the method session.saveOrUpdate(a);
I know that my database has a record with the above composite key....
so..I just want to update the remaining 3 rows for which i have set new values. I want the reamining 5 columns with the values that already existed.
But what is happening is the 5 colums(with the new values) that i set are seen in the database, but the values for the reamining 5 columns are set to 'null' in the database coz these columns also got updated(since i did not set any values for these, the default values null was set).
I want to avoid this and I want to update only columns that i set the values for??
Can anyone help me regarding this...!!!
|