There are two ways to solve this problem related to context -
First - If you want to set password property as immutable (then you can't change password form User entity).
Map password property as
update=false, so this property value will never will appear in Update statement of User.
Like
Code:
<properties name="password"update="false">
If your are use JPA then
@Column(name="PASSWORD",updatable="false")
Second- If you want to update password property whenever your change it. (Means password should be only be come in update statement, if you change the value of it).
Map the User class using
dynamic-update="true". Then password column appear in the update statement of user table only when you change the value of password property of user class. If you set
dynamic-update="true" in a class, Hibernate at run time find out what properties has change and then only changed property will appear in update statement.
Code:
<class name="User" table="user_table" dynamic-update="true"/>