String res = "updateUserGroup";
if (checkUserLevel(user_level)) {
try {
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
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();
res = "Success: " + updatedEntities;
tx.commit();
PersistenceSessionUtil.closeSession(idf);
} catch (Exception ex2) {
log.error("updateUserGroup",ex2);
}
} else {