I am getting this problem:
java.lang.String cannot be cast to java.lang.Enum
When I try this HQL:
...
query = em.createQuery("SELECT object from Entity object where object.column = ?");
query.setParameter(1, "X");
return query.getResultList();
Where in DB the type is a Varchar2(x) with a check constraint and the variable in the entity is defined with Enum using the tag @Enumerated(EnumType.STRING):
public enum ColumnEnum {
X, Y;
}
query.setParameter(1, TypeEnum.X);?