String res = "UpdateGroup";
if (checkUserLevel(user_level)) {
try {
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
String hqlUpdate = "update Usergroups set user_id = :user_id,level_id = :level_id, name = :name, description = :description, updatetime = :updatetime, comment = :comment where usergroup_id= :usergroup_id";
int updatedEntities = session.createQuery(hqlUpdate).setParameter(
"user_id", USER_ID.longValue()).setParameter("level_id",
level_id.longValue()).setParameter("name", name)
.setParameter("description", description).setParameter(
"updatetime",
new Long(-1))
.setParameter("comment", comment).setParameter("usergroup_id",
usergroup_id.longValue()).executeUpdate();
res = "Success" + updatedEntities;
tx.commit();
PersistenceSessionUtil.closeSession(idf);
} catch (Exception ex2) {
log.error("updateGroup",ex2);
}
} else {