| I just hit this moving up to a newer version of Hibernate validator; it used to work fine. The problem is that declaring the constraint on the superclass instead of the subclass isn't an option if what you want to say is e.g. "Id must not be null for instances of MyClass, but may be null for instances of other subclasses of MyObject". In other words although the getter is defined on the superclass, whether it is allowed to be null depends on the subclass. |