Annotations on fields in nested embeddable collection elements are ignored


When AccessType.FIELD is used, annotations on a field in an @Embeddable will be ignored if it is nested in an @Embeddable used as a collection element.

There is no problem when AccessType.PROPERTY is used.




Gail Badner
October 4, 2016, 5:50 PM

, I see a commit for this jira has a test case: .

I don't remember if the commit is the same test case, but it does reproduce the issue.

Steve Ebersole
September 30, 2016, 3:14 PM

Has the test case from HHH-10651 been applied upstream at all?

Thomas Göttlich
September 30, 2016, 3:08 PM

This issue seems to apply to version 5.1 as well. In our case we have field access for all properties except the identifier due to not trigger a lazy load when just calling getIdentifier().

If you have a look at line 1445 of CollectionBinder in version 5.1 you'll notice that the access type is being guessed based on the identifier's access type, which in our case happens to be "property" (and which is the only field to have that access type). We're using version 4.3.11 at the moment and found it there so I can't tell whether it really applies to 5.1 but that portion of the code seems to be the same so it's very likely.

There's also a comment "FIXME support @Access for collection of elements" which indicates a solution for the problem.

Gail Badner
March 28, 2016, 6:59 PM

HHH-10651 has a good test case for this.

Steve Ebersole
October 28, 2015, 3:25 AM

As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.




Gail Badner