if(resource != null) {
DefaultPermisibleResource defaultResource = new DefaultPermisibleResource(resource);
criteria.add(Restrictions.eq("resource", defaultResource));
}
if(entity != null) {
DefaultPermissionEntity defaultEntity = new DefaultPermissionEntity(entity);
criteria.add(Restrictions.eq("entity", defaultEntity));
}
return criteria.list();
} catch (Exception a_th) {
throw new RuntimeException(a_th);