Details
Description
When using a Java domain model with inheritance and supplying the WhateverContraints.groovy files, constraints are not inherited for extending classes, eg:
class A
has "AConstraints.groovy", which are invoked for validate()
class B extends A
does not have any constraints of it's own, and nothing is used for validate() so I get raw DB errors when trying to save invalid objects
In my case class B was not providing any new DB columns that A did not have itself, although it does have a few extra properties, which are represented by different DB tables. So I thought it would be reasonable that B should inherit constraints from A.
Also, is it worth considering the situation where a developer might want to inherit superclass constraints and override some of them too?
This issue still seems to affects my *Constraints.groovy files with Grails 1.0.3. Any chance of this being fixed soon as it's a fairly major issue that has been around for a couple of years now?