I have re-tested [HHH-10857] with Hibernate 5.4.15:
* For “simple” Embeddables (directly used in the Entity as @Embedded), @Convert annotation works.
* For Embeddables in ElementCollections, @Convert annotation also works now. So, the original issue [HHH-10857] seems to be fixed.
* However, in the following situation, @Convert is still ignored: ** I have an Element Collection of an Embeddable OuterEmbeddable. ** “OuterEmbeddable“ contains another Embeddable called InnerEmeddable ** Within InnerEmeddable I use @Convert on basic fields. But it is ignored.
My current workaround is to use @Convert one level higher:
{code:java}@Embeddable class OuterEmbeddable{ @Convert(converter = MyConverter.class, attributeName = "theFieldToConvert") InnerEmeddable theInnerEmbeddable }{code}
My testcase reveals some more details:
* It works if I will create a test case asap enforce field level access on the embeddables by “@Access(AccessType . FIELD)“ * The error occurs (but only on the inner embeddable) if I do not enforce field level access. |
|