Troubleshooting
Problem
You receive an open JPA 500 Error : JPQL does not support conditional expression over embeddable class.
Symptom
Error 500: <openjpa-2.1.2-SNAPSHOT-r422266:1384519 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: An error occurred
while parsing the query filter 'SELECT e FROM Map e
where e.MapPK = :ProdCMapPK'.
Error message: JPQL query does not support conditional expression
over embeddable class. JPQL string: "ProdMapPK".
Cause
Incorrect JPQL placed in to open JPA entity used to select information from a database. The JPA 2.0 specification section 4.12 states the following:
"Comparisons over instances of embeddable class or map entry types are not supported."
Environment
Open JPA 2.0 and higher
Diagnosing The Problem
Look up conditional expressions and embeddable classes in the JPA specification.
Resolving The Problem
Change the select statement to:
SELECT e FROM Map e where e.MapPK.empName = :name and e.MapPK.empNumber=:number"
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21623645