Pessoal,
Alguém pode me ajudar com a sintaxe do nextval postgre no createQuery do EntityManager???
Já estou desesperado…
(desenvolvimento web com JEE, EJB, JPA e JSF)
Estou fazendo assim:
public Integer getIdPessNextval(){
Query q = getEntityManager().createQuery("select nextval('pessoa_idpess_seq');");
return (Integer) q.getSingleResult();
}
E está aparecendo a seguinte página de erro:
Caused by: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Syntax error parsing the query [select nextval('pessoa_idpess_seq');], line 1, column 14: syntax error at [(].
Internal Exception: MismatchedTokenException(81!=32)
A pricipio parece que a query está certa, mas aparece este erro no parentese…
Aguém pode me ajudar por favor???
Grato!
