Top Description Methods
org.hibernate.annotations

public @Interface ConverterRegistration

extends Annotation
Annotations
@Target:TYPE, ANNOTATION_TYPE, PACKAGE
@Retention:RUNTIME
@Repeatable:ConverterRegistrations
Imports
java.lang.annotation.Repeatable, .Retention, .Target, jakarta.persistence.AttributeConverter, .Converter

Registers an jakarta.persistence.AttributeConverter. The main purpose is to be able to control jakarta.persistence.Converter#autoApply() external to the actual converter class, which might be useful for third-parties converters.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public boolean
autoApply()

Should the registered converter be auto applied for converting values of its reported domain type?

public Class<? extends AttributeConverter<?, ?>>
converter()

The converter class to register

public Class<?>
domainType()

The domain type to which this converter should be applied.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

autoApplyback to summary
public boolean autoApply()

Should 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.

converterback to summary
public Class<? extends AttributeConverter<?, ?>> converter()

The converter class to register

domainTypeback to summary
public Class<?> domainType()

The 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 with Converter#autoApply() set to false and auto-apply them.

With autoApply() set to false, this will effectively override converters defined with Converter#autoApply() set to true and disable auto-apply for them.