public boolean minimoUmSuperUsuario(Usuario usuario, Session sessionExterna) throws HibernateException {
Criteria crit = sessionExterna.createCriteria(Usuario.class);
return (Long) crit.uniqueResult() > 0;
}
I need to do the following task:
select * from usuario where superusuario and usuarioativo = true
Make this select in hibernate in a boolean method and return:
if quantide de super usuario e ativo == 1 retornar true
else false.
I do not know how to implement this in the above method.