Parsing error in JPQL query [message #630847] |
Tue, 05 October 2010 09:56 |
Kiran Messages: 8 Registered: October 2010 |
Junior Member |
|
|
I have the following NamedQuery
OaaFlexrolesUnitT.findByRole: select distinct a.unit,b.unitName,a.division,b.divName,c.name,a.netid,a.empl name from OaaFlexrolesUnitT a, DeptDivUnitRepNyuT b, OaaRolesT c where a.unit = TRIM(BOTH FROM b.unitNo) and a.division = TRIM(BOTH FROM b.divNo) and a.roleId = c.roleId and a.roleId = :roleId order by to_number(a.unit),to_number(a.division)
This query is giving me the following exception
javax.ejb.EJBException: EJB Exception: : Local Exception Stack:
Exception [EclipseLink-8023] (Eclipse Persistence Services - 1.0.2 (Build 20081024)): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing the query [OaaFlexrolesUnitT.findByRole: select distinct a.unit,b.unitName,a.division,b.divName,c.name,a.netid,a.empl name from OaaFlexrolesUnitT a, DeptDivUnitRepNyuT b, OaaRolesT c where a.unit = TRIM(BOTH FROM b.unitNo) and a.division = TRIM(BOTH FROM b.divNo) and a.roleId = c.roleId and a.roleId = :roleId order by to_number(a.unit),to_number(a.division)].
Internal Exception: org.eclipse.persistence.internal.libraries.antlr.runtime.Ear lyExitException
What might be causing the error. Is to_number not allowed in JPQL? Is there any equivalent or should I use native query?
Regards
Kiran
|
|
|
|
Powered by
FUDForum. Page generated in 0.02782 seconds