I'm using JPA2DataSource with a SmartGWT 3.1p Pro and it is throwing this exception (with 3.0p version it was perfectly ok).
As far as I know "count(*)" is not a valid construct in JPQL.
Any help is welcome.
Best regards,
Heleno
Code:
Exception [EclipseLink-0] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.JPQLException Exception Description: Syntax error parsing [select count(*) from VwUserVehicleHistory _VwUserVehicleHistory where (_VwUserVehicleHistory.eventType = :p0 and _VwUserVehicleHistory.eventType is not null and (_VwUserVehicleHistory.status <> :p1 or _VwUserVehicleHistory.status is null) and _VwUserVehicleHistory.user = :p2 and _VwUserVehicleHistory.user is not null and _VwUserVehicleHistory.type = :p3 and _VwUserVehicleHistory.type is not null and (_VwUserVehicleHistory.destinyClientId is null or _VwUserVehicleHistory.destinyClientId = :p4 and _VwUserVehicleHistory.destinyClientId is not null))]. [13, 13] The left expression is missing from the arithmetic expression. [14, 14] The right expression is missing from the arithmetic expression. at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildException(HermesParser.java:150) at org.eclipse.persistence.internal.jpa.jpql.HermesParser.validate(HermesParser.java:325) at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:270) at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildQuery(HermesParser.java:157) at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:138) at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:112) at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:98) at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:82) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1510) at com.isomorphic.jpa.JPADataSource.createQuery(JPADataSource.java:1212) at com.isomorphic.jpa.JPADataSource.executeFetch(JPADataSource.java:584) at com.isomorphic.datasource.DataSource.execute(DataSource.java:1368) at com.isomorphic.jpa.JPADataSource.execute(JPADataSource.java:543)
As far as I know "count(*)" is not a valid construct in JPQL.
Any help is welcome.
Best regards,
Heleno
Comment