Hi,
I have a case where I have a JPQL query like:
"select o from MyEntity o WHERE (enumField IN :enumFieldList)"
And enum field is defined in MyEntity as:
@Enumerated(EnumType.STRING) @Column(nullable = false) @Index private MyEnumType enumField;
And MyEnumType is defined as:
public enum MyEnumType { VALUE1, VALUE2, VALUE3, VALUE4 }
and I call:
query.setParameter("enumFieldList", Arrays.asList(MyEnumType.VALUE1, MyEnumType.VALUE2));
Then query.getResultSet() *always* returns an empty list.
BUT if (for example) I try "WHERE (enumField = : enumField1) OR (enumField = :enumField2)" with:
query.setParameter("enumField1", MyEnumType.VALUE1); query.setParameter("enumField2", MyEnumType.VALUE2);
Then the matching objects are returned.
I understood the JPA JPQL IN clause should work with Enum types - is that the case, or is this an objectdb bug ?
Thanks