How to use Enum as NamedQuery parameters in JPA
- by n002213f
I have an Entity with a enum attribute and a couple on NamedQueries. One of these NamedQueries has a the enum attribute as a parameter i.e.
SELECT m FROM Message m WHERE status = :status
When i try to ru n the query i get the following error;
Caused by: java.lang.IllegalArgumentException: You have attempted to set a value of type class my.package.Status for parameter status with expected type of class my.package.Status from query string SELECT m FROM Message m WHERE m.status = :status.
I'm using Toplink
How is this? How would i make JPA happy?