iam new in hibernate, i have a entity class named student, it have 5 field, name, age, address, phone, and sex.
then i want to update name and age field.
student.setName("foo");
student.setAge("11");
getHibernateTemplate().update(student);
after i ran the code, the other field value become null, except the two field in the code above. i expecting my other field to stay as it is.
any suggest is deeply appreciated
btw sorry for my bad english
For updating value first of all you have to get the value by primary key and then update the object(Bean) then update method should be called.