On Sat, Mar 31, 2018 at 2:19 PM, Gunnar Morling <gunnar(a)hibernate.org>
wrote:
> - If more than one are marked with @UnwrapByDefault, a
> ConstraintDeclarationException is raised.
>
> I don't think we can or should do this, instead no extractor should be
applied in this case. It'd contradict quite clearly the spec's wording
"Otherwise, no value extractor is applied." Also the idea was that
implicitly applied extractors should be applied implicitly if it's doable
unambiguously, but they shouldn't cause any sort of configuration exception
otherwise.
Yes, I'm stating that the spec is incorrect here and should be corrected.
In all the other cases when we have competing value extractors, we throw an
error. Why not in this case?
Typically, you would have your constraints applied on the container
elements, then you add another value extractor, and your constraints are
then applied silently to the container instead of the container elements.
That sounds like the wrong approach.
--
Guillaume