[bv-dev] OverridesAttribute questions

Matt Benson mbenson at apache.org
Tue Jun 6 12:17:34 EDT 2017


On Tue, Jun 6, 2017 at 8:06 AM, Gunnar Morling <gunnar at hibernate.org> wrote:
> Hi Matt,
>
> 2017-06-04 0:28 GMT+02:00 Matt Benson <mbenson at apache.org>:
>> I have a couple of questions about @OverridesAttribute:
>>
>> 1. The spec says that #name() defaults to the name of the annotated
>> attribute, but there is actually no default value declared. Should(n't) we
>> declare as ""?
>
> Great catch. I've filed
> https://hibernate.atlassian.net/browse/BVAL-634, PR for API and spec
> coming up in a bit.
>
>>
>> 2. I don't have a clear understanding from the spec what the expectations
>> are if there is a single override specified using the default
>> constraintIndex value, but with multiple composing constraints of the
>> specified type. Does the override apply to all? Is it an error?
>
> It's my expectation that an error would be raised. I would say it
> falls into the category of
>
>     "If the composition is invalid, e.g. [...] a single attribute
> mapped to more than one source attribute [...] a
> ConstraintDefinitionException is raised"
>
> Let me know if you think that's too vague and we should add this case
> more explicitly to the list of erroneous overrides discussed in the
> spec.
>

I suppose it is at least implicitly covered by the wording "If index
is undefined, the single constraint declaration is targeted," i.e.
"single" is an assumption which, if violated, can trigger the CDE.

Thanks,
Matt

>>
>> Matt
>
> --Gunnar
>
>>
>> _______________________________________________
>> beanvalidation-dev mailing list
>> beanvalidation-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev


More information about the beanvalidation-dev mailing list