Blazebit / blaze-persistence

Rich Criteria API for JPA providers
https://persistence.blazebit.com
Apache License 2.0
742 stars 90 forks source link

Add support for enum basic type in VALUE clause #562

Open Mobe91 opened 6 years ago

Mobe91 commented 6 years ago

Description

Currently we cannot use enums in the VALUES clause:

.fromValues(MyEnum.class, "myEnum", MyEnum.values())

A workaround is to use the underlying type the enum is mapped to.

Expected behavior

That it simply works

Actual behavior

Produces an exception

Steps to reproduce

See code above

Environment

Version: 1.2.0 JPA-Provider: Hibernate 5.2 DBMS: - Application Server: -

beikov commented 6 years ago

Another option is to make use of the fromValuesLike function introduced in 1.3.0.