You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
metadataBuilder.applySqlFunction requires a FunctionReturnTypeResolver which in turns require types to extend from ReturnableType
metadataBuilder.applySqlFunction requires a FunctionArgumentTypeResolver which in turns require types to extend from MappingModelExpressible<?>, like for example BasicValuedMapping is.
TypedParameterValue requires a BindableType, like for example SqmExpressible is.
I think in order to support custom functions and typed parameters the following signature changes need to be made:
Make MutableType additionally extend from ReturnableType<T>. This only allows the introduction of getPersistenceType and getJavaType at MutableType level.
Make ImmutableType extend from UserType<T>, BindableType<T>, SqmExpressible<T>, BasicValuedMapping, ReturnableType<T> instead of MutableType, like MutableType.
Whilst the new type system of Hibernate 6.0 is one of its key features, I am currently not really seeing it. It could well be possible that more changes will be required. At this point we may want to just go for BasicType extensions instead ... The org.hibernate.usertype.UserType hierarchy seems fairly limited in its current abilities.
The text was updated successfully, but these errors were encountered:
The problem with BasicType is that users will no longer be able to define the @Type on the entity attribute.
However, we could investigate whether we could provide the user a JsonJavaType and JsonJdbcType which they could use as an alternative to the standard JsonType, and those could address the problems you mentioned.
We're getting pretty far with this using the CustomType wrapper in Hibernate, but we're currently limited by this limitation in Hibernate: hibernate/hibernate-orm#6258 . I'll keep updating this thread as I make progress with getting custom functions to work with custom types (both as argument and return type of functions).
metadataBuilder.applySqlFunction
requires aFunctionReturnTypeResolver
which in turns require types to extend fromReturnableType
metadataBuilder.applySqlFunction
requires aFunctionArgumentTypeResolver
which in turns require types to extend fromMappingModelExpressible<?>
, like for exampleBasicValuedMapping
is.TypedParameterValue
requires aBindableType
, like for exampleSqmExpressible
is.I think in order to support custom functions and typed parameters the following signature changes need to be made:
MutableType
additionally extend fromReturnableType<T>
. This only allows the introduction ofgetPersistenceType
andgetJavaType
atMutableType
level.ImmutableType
extend fromUserType<T>, BindableType<T>, SqmExpressible<T>, BasicValuedMapping, ReturnableType<T>
instead ofMutableType
, likeMutableType
.Whilst the new type system of Hibernate 6.0 is one of its key features, I am currently not really seeing it. It could well be possible that more changes will be required. At this point we may want to just go for
BasicType
extensions instead ... Theorg.hibernate.usertype.UserType
hierarchy seems fairly limited in its current abilities.The text was updated successfully, but these errors were encountered: