}
return groups;
}
public Usergroups getSingleGroupFree(Long user_level, Long usergroup_id) {
Usergroups groups = new Usergroups();
if (checkConfLevel(user_level)) {
try {
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
Query query = session
.createQuery("select c from Usergroups as c where c.usergroup_id = :usergroup_id AND c.level_id = :level_id");
query.setParameter("usergroup_id", usergroup_id.longValue());
query.setParameter("level_id", 1);
for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
groups = (Usergroups) it2.next();
}
tx.commit();
PersistenceSessionUtil.closeSession(idf);
//Todo: Set user
//groups.setUsers(ResHandler.getUsermanagement().getUser(groups.getUSER_ID()));
} catch (Exception ex2) {
log.error("getSingleGroupFree",ex2);
}
} else {
groups.setComment("Error: Permission denied");
}
return groups;
}