Here is my stripped down class and enum.
class A
{
@Enumerated (value = EnumType.STRING)
AType type;
}
enum AType
{
X,Y
}
if I run
query = FROM A a WHERE a.type = :type
query.setParameter("type", AType.X);
All is fine and dandy.
However if I do the following:
AType[] types = new AType[1];
types[0] = AType.X;
query = FROM A a WHERE a.type IN (:types)
query.setParameter("types", types);
I get:
Lcom.src.AType; cannot be cast to java.lang.Enum
If I do:
Enum[] types = new Enum[1];
types[0] = AType.X;
query = FROM A a WHERE a.type IN (:types)
query.setParameter("types", types);
I get:
Ljava.lang.Enum; cannot be cast to java.lang.Enum
Any ideas?