0
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 on Hibernate in a Boolean method and return:
if quantide de super usuario e ativo == 1 retornar true
else false.
I don’t know how to implement this in the above method.
I believe in your
query
you need to put like this:select * from usuario where superusuario = true and usuarioativo = true
– R.Santos