Hibernate - duvida (resolvido)

2 respostas
jonasjgs2
select g from Gerenc g where g.gerencPK.gncmodulo = 'MASTER00' and (substring(g.gncprivilegio,1,1) = 'A' or (substring(g.gncprivilegio,2,1) = 'B' ) order by g.gerencPK.gncmodulo,g.gncordem

o que tem de errado nesta consulta
esta me dando um erro:

java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: order near line 1, column 157 [select g from tabelas.Gerenc g where g.gerencPK.gncmodulo = MASTER00 and (substring(g.gncprivilegio,1,1) = A or (substring(g.gncprivilegio,2,1) = B ) order by g.gerencPK.gncmodulo,g.gncordem]

at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1374)

at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)

at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:294)

2 Respostas

Hebert_Coelho

Tá faltando fechar um parêntese. [=

jonasjgs2

obrigadao heberte…

Criado 2 de julho de 2014
Ultima resposta 2 de jul. de 2014
Respostas 2
Participantes 2