tx.begin();
String hqlUpdate = " UPDATE Users_Usergroups set "
+ " usergroup_id = :usergroup_id, user_id = :user_id, "
+ " updatetime = :updatetime, comment = :comment "
+ " where users_usergroups_id= :users_usergroups_id";
int updatedEntities = session.createQuery(hqlUpdate).setParameter(
"usergroup_id", usergroup_id.longValue()).setParameter(
"user_id", user_id.longValue()).setParameter("updatetime",
new Long(-1)).setParameter(
"comment", comment).setParameter("users_usergroups_id",
users_usergroups_id.longValue()).executeUpdate();