| Yes, declaring constraints in the class declaration is neither supported by Hibernate Validator nor by the Bean Validation spec at the moment. So this is expected. Right now, there is not much you can do to work around it, except use the first form you presented. I suspect we would need quite a few changes to support this. |