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 is not accepting the ID(THIS) operation when supplied as an argument to another JPQL function, such as LOWER,
FROM Vehicle WHERE LOWER(ID(THIS)) = ?1
The error raised is:
java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Syntax error parsing [ FROM Vehicle WHERE LOWER(ID(THIS)) = ?1].
[37, 45] The encapsulated expression is not a valid expression. (SELECT this FROM Vehicle WHERE LOWER( [ LOWER(ID(THIS)) ] ...
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1848)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1869)
at io.openliberty.data.internal.persistence.RepositoryImpl.invoke(RepositoryImpl.java:1133)
... 38 more
Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 5.0.0-B03.v202409121024-4a7149f0cd04d7466837d70f68abb743c88acb83): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing [ FROM Vehicle WHERE LOWER(ID(THIS)) = ?1].
[37, 45] The encapsulated expression is not a valid expression. (SELECT this FROM Vehicle WHERE LOWER( [ LOWER(ID(THIS)) ] ...
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:
See pull request above. I see one issue with provided example ....WHERE LOWER(ID(THIS)) = .... This example is not type safe. It should fail if result from ID(THIS) will be some numeric type. This is why in my tests in PR #2287 is ID( wrapped by CAST (.
EclipseLink is not accepting the ID(THIS) operation when supplied as an argument to another JPQL function, such as LOWER,
FROM Vehicle WHERE LOWER(ID(THIS)) = ?1
The error raised is:
The text was updated successfully, but these errors were encountered: