Changes and improvements
QueryValueType
The QueryValueType
enumeration is used to indicate the type of an object passed to a query constraint. Usually a
developer will not interact with this, as every constraint factory method that takes it as a parameter, also comes with
a variant that does not. In the latter case, the type will be inferred from the object that is passed to the constraint.
This can only be inferred for known types, which is mostly primitives and java.util.Date
.
As a default, when not recognized, the type would automatically be set to String, resulting into a conversion of the
object to String in supporting constraints. With this update the type QueryValueType.OBJECT
was added which handles
the supplied object as a raw value that is passed directly into JPA, as this is sometimes desired.
Since converting to String is typically not intended behavior for objects that are not of that type, the default when a
type cannot be determined is now QueryValueType.OBJECT
. This is a breaking change, but should have very little impact,
as currently, cases where unknown object types are passed to a constraint are likely to be unintended. In cases where
this is intended, the migration guide will explain how to resolve this in the new
implementation.