datanucleus-core
datanucleus-core copied to clipboard
Allow type converters to be defined at class-level to allow override of superclass field converters
With a JPA @Convert we can then do
public class BaseClass
{
@Convert(converter=MyConv1.class)
MyType myField;
}
@Convert(attributeName="myField", converter=MyConv2.class)
public class SubClass
{
...
}
This will mean that when checking if a field has a converter we need to go via the ClassMetaData, which will find out for the member, firstly checking for class-level overrides, then member specifications.
I believe that the member (field/property) annotation should override the type (class) default specification. So by default, if a member is of a type that is defined as having a converter and has no annotation, the member uses that converter. But a member could still override that default by explicitly naming a different converter via an annotation.