Annotation Interface CustomValueType


Annotates the class, or entity field/record component as having a custom value converter.
The specified converter will be used by YOJ instead of the default (Database column↔Java field) mapping.
Defining recursive custom value types is prohibited: that is, you cannot have a custom value type with a converter that returns value of another custom value type.
  • This annotation is inherited, so make sure that your converter either supports all possible subclasses of your class, or restrict subclassing by making your class final or sealed.
  • This is a meta-annotation: it can be applied to other annotations; if you use these annotations, YOJ will correctly apply the @CustomValueType annotation. This allows to define custom value type configuration once and then re-use it in multiple classes.
  • @Column(customValueType=...) annotation on an entity field/record component has priority over annotation on the field's/record component's class. @Column is also a meta-annotation, so you can define custom value types for individual columns using @Column.customValueType.
See Also: