Jan-Willem Gmelig Meyling (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYWQyY2NjZGYx...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16749?atlOrigin=eyJpIjoiYWQyY2...
) HHH-16749 (
https://hibernate.atlassian.net/browse/HHH-16749?atlOrigin=eyJpIjoiYWQyY2...
) FunctionTypeResolver does not have access to CustomType (
https://hibernate.atlassian.net/browse/HHH-16749?atlOrigin=eyJpIjoiYWQyY2...
)
Issue Type: Bug Assignee: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Created: 05/Jun/2023 04:35 AM Priority: Major Reporter: Jan-Willem Gmelig Meyling (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
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
final DomainType<Y> metaModelType = determineSimpleType(
singularAttributeMetadata.getValueContext(), metadataContext );
Why is:
final DomainType<Y> metaModelType =
singularAttributeMetadata.getPropertyMapping().getType() instanceof
DomainType ?
(DomainType<Y>)
singularAttributeMetadata.getPropertyMapping().getType() :
determineSimpleType( singularAttributeMetadata.getValueContext(),
metadataContext );
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.
(
https://hibernate.atlassian.net/browse/HHH-16749#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16749#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:4a1ccf9 )