Search in sources :

Example 1 with Target

use of org.hibernate.annotations.Target in project hibernate-orm by hibernate.

the class BasicValueBinder method normalSupplementalDetails.

private void normalSupplementalDetails(XProperty attributeXProperty) {
    explicitJavaTypeAccess = typeConfiguration -> {
        final org.hibernate.annotations.JavaType javaTypeAnn = findAnnotation(attributeXProperty, org.hibernate.annotations.JavaType.class);
        if (javaTypeAnn != null) {
            final Class<? extends BasicJavaType<?>> javaType = normalizeJavaType(javaTypeAnn.value());
            if (javaType != null) {
                final ManagedBean<? extends BasicJavaType<?>> jtdBean = getManagedBeanRegistry().getBean(javaType);
                return jtdBean.getBeanInstance();
            }
        }
        final Target targetAnn = findAnnotation(attributeXProperty, Target.class);
        if (targetAnn != null) {
            return (BasicJavaType<?>) typeConfiguration.getJavaTypeRegistry().getDescriptor(targetAnn.value());
        }
        return null;
    };
    normalJdbcTypeDetails(attributeXProperty);
    normalMutabilityDetails(attributeXProperty);
    final Enumerated enumeratedAnn = attributeXProperty.getAnnotation(Enumerated.class);
    if (enumeratedAnn != null) {
        enumType = enumeratedAnn.value();
    }
    final Temporal temporalAnn = attributeXProperty.getAnnotation(Temporal.class);
    if (temporalAnn != null) {
        temporalPrecision = temporalAnn.value();
    }
}
Also used : MapKeyEnumerated(jakarta.persistence.MapKeyEnumerated) Enumerated(jakarta.persistence.Enumerated) Target(org.hibernate.annotations.Target) BasicJavaType(org.hibernate.type.descriptor.java.BasicJavaType) Temporal(jakarta.persistence.Temporal) MapKeyTemporal(jakarta.persistence.MapKeyTemporal)

Aggregations

Enumerated (jakarta.persistence.Enumerated)1 MapKeyEnumerated (jakarta.persistence.MapKeyEnumerated)1 MapKeyTemporal (jakarta.persistence.MapKeyTemporal)1 Temporal (jakarta.persistence.Temporal)1 Target (org.hibernate.annotations.Target)1 BasicJavaType (org.hibernate.type.descriptor.java.BasicJavaType)1