I don’t know what your actual problem is, but when I use your code of MyType, set it to public and change the code of the disassemble method from
@Override
public Serializable disassemble(MyId value) {
return value.text;
}
to
@Override
public Serializable disassemble(MyId value) {
return value;
}
it works in my test case. If I don’t do this adjustment I get a CIRCULAR REFERENCE: java.lang.ClassCastException. If there are other problems it would be interesting for me to know about them in order to decide whether we can use this EnhancedUserType. |