You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EclipseLink raises an error The left expression is not an arithmetic expression (same as #2183 but which was for UPDATE) when a SELECT query performs an arithmetic expression on entity attributes that have the optional entity identifier variable omitted.
JPQL:
SELECT publicDebt / numFullTimeWorkers FROM DemographicInfo WHERE EXTRACT (YEAR FROM collectedOn) = ?1
Error:
java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Syntax error parsing [SELECT publicDebt / numFullTimeWorkers FROM DemographicInfo WHERE EXTRACT (YEAR FROM collectedOn) = ?1].
[7, 17] The left expression is not an arithmetic expression. (SELECT [ publicDebt / numFullTimeWorkers ] ...
[20, 38] The right expression is not an arithmetic expression. (SELECT publicDebt / [ publicDebt / numFullTimeWorkers ] ...
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1848)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1869)
... 38 more
Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 5.0.0.v202408200932-f556522e743c87b8097f78cefe2b8f24f68cf79e): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing [SELECT publicDebt / numFullTimeWorkers FROM DemographicInfo WHERE EXTRACT (YEAR FROM collectedOn) = ?1].
[7, 17] The left expression is not an arithmetic expression. (SELECT [ publicDebt / numFullTimeWorkers ] ...
[20, 38] The right expression is not an arithmetic expression. (SELECT publicDebt / [ publicDebt / numFullTimeWorkers ] ...
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildException(HermesParser.java:175)
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.validate(HermesParser.java:351)
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:298)
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildQuery(HermesParser.java:180)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:144)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:120)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:107)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:91)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1846)
... 40 more
The text was updated successfully, but these errors were encountered:
EclipseLink raises an error
The left expression is not an arithmetic expression
(same as #2183 but which was for UPDATE) when a SELECT query performs an arithmetic expression on entity attributes that have the optional entity identifier variable omitted.JPQL:
Error:
The text was updated successfully, but these errors were encountered: