| Alexander Nurmsalu thanks for the test case. I don't think it's a bug (at least not in your test case), I think it's more an issue with how you use value extractors. The GenericBean2 value extractor is used to extract the Integer value you have in YourAnnotatedBean. And in your GenericBean2 value extractor, you return 2 values, one of them is null so you get a violation of the not null constraint. Value extractors are used for container cascading and container element constraints (i.e. when you have elements in a List, Map or something similar). Here you have plain old beans so you don't need value extractors. In the case you presented in your test case, GenericBean2 is not a container, it's a bean, so it makes no sense to add a constraint to the Integer type argument. Use @Valid on your bean declarations to cascade (and you don't need value extractors for that, Hibernate Validator will cascade to the properties of your beans annotated with @Valid), and put the constraints on your properties definitions. I hope it helps. If it's not clear, feel free to ask. |