I'm struggeling to get the CustomType instance from a DynamicParameterizedType through an argument expression in a FunctionTypeResolver. The CustomType is replaced by the AttributeFactory by context.resolveBasicType( typeContext.getJpaBindableType). This is problematic for CustomTypes and in particular DynamicParamererizedTypes. Instead of the (parameterized) custom type instance, you get the basic type from the registry, which defaults to BasicTypeImpl(SerializableJavaType) which has lost all the custom type / parameterized data. In
Why is:
Not considered? CustomType<X> implements DomainType<X>}}through {{ConvertedBasicType<X>, however currently the metamodel instead represents the attribute as a BasicTypeImpl(SerializableJavaType) Use case : custom functions that operate on custom types that get its typing from a generic bound. For example: LOWER(<range>) which operates on a Range<LocalDateTime> should return the basic type of LocalDateTime. In Hibernate 5 it was possible to extract the generic bound from the custom type, but in 6.x this custom type is shadowed by a basic type for the raw class. |