lundi 25 juillet 2016

Update in hibernate with single database query

Suppose I have an employee class which has 3 fields - empId, empName and empAddress.

I want to update only address of employee with empId say 1. If I use session.update(emp), it will set empName as null, of course I don't want that.

Is there any way to achieve this in a single database query without using hql.

Aucun commentaire:

Enregistrer un commentaire