Pessoal,
Estou tentando pegar o MAX de um determinado atributo e sempre estou recebendo null como retorno.
Já tentei NativeQuery, NamedQuery e Query mas nada…
Abaixo algumas formas que já tentei…
entityManager.createNativeQuery("select MAX(sequencia) as maxseq from tabela").getSingleResult()
entityManager.createQuery("select MAX(sequencia) as maxseq from tabela").getSingleResult()
Tanto com getSingleResult() quanto com getResultList(), sempre retorna nulo…
Uso o Hibernate 4.3.0.final como provedor de JPA
Alguma idéia?