class HibernateGroupDAO extends HibernatePersistentObjectDAO<Group> implements GroupDAO {

	@Override
	public Group findByName(String name, long tenantId) {
		Group group = null;
		try {
			Collection<Group> coll = findByWhere(
					"_entity.tenantId=" + tenantId + " and _entity.name = '" + SqlUtil.doubleQuotes(name) + "'", null,
					null);
			if (coll.size() > 0) {
				group = coll.iterator().next();
				if (group.getDeleted() == 1)
					group = null;
			}
		} catch (PersistenceException e) {
			log.error(e.getMessage(), e);
		}
		return group;
	}

	private  HibernateGroupDAO();

}