Package org.hibernate.annotations
Annotation Interface ConverterRegistration
@Target({TYPE,ANNOTATION_TYPE,PACKAGE})
@Retention(RUNTIME)
@Repeatable(ConverterRegistrations.class)
public @interface ConverterRegistration
Registers an
AttributeConverter
. The main
purpose is to be able to control Converter.autoApply()
external to the actual converter class, which might be useful for third-parties
converters.-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionClass<? extends AttributeConverter<?,
?>> The converter class to register -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Should the registered converter be auto applied for converting values of its reported domain type?Class<?>
The domain type to which this converter should be applied.
-
Element Details
-
converter
Class<? extends AttributeConverter<?,?>> converterThe converter class to register
-
-
-
domainType
Class<?> domainTypeThe domain type to which this converter should be applied. This allows refining the domain type associated with the converter e.g. to apply to a subtype.With
autoApply()
set to true, this will effectively override converters defined withConverter.autoApply()
set tofalse
and auto-apply them.With
autoApply()
set to false, this will effectively override converters defined withConverter.autoApply()
set totrue
and disable auto-apply for them.- Default:
- void.class
-
autoApply
boolean autoApplyShould the registered converter be auto applied for converting values of its reported domain type?Defaults to true as that is the more common use case for this annotation.
- Default:
- true
-