Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

id(this) is not accepted as an argument to a function #29893

Closed
njr-11 opened this issue Oct 18, 2024 · 1 comment · Fixed by #30352
Closed

id(this) is not accepted as an argument to a function #29893

njr-11 opened this issue Oct 18, 2024 · 1 comment · Fixed by #30352
Labels
bug This bug is not present in a released version of Open Liberty in:JPA team:Blizzard

Comments

@njr-11
Copy link
Contributor

njr-11 commented Oct 18, 2024

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
@njr-11 njr-11 added bug This bug is not present in a released version of Open Liberty in:JPA team:Blizzard labels Oct 18, 2024
@anija-anil
Copy link
Contributor

See EclipseLink Issue : 2286

njr-11 added a commit to njr-11/open-liberty that referenced this issue Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This bug is not present in a released version of Open Liberty in:JPA team:Blizzard
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants