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
EclipseLink is not accepting the ID(THIS) operation when supplied as an argument to another JPQL function, such as LOWER,
The error raised is: