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)