We are looking for a Java library/system/package which not only does basic validation but also can do relationship validation. We need to be able to express validation criteria which is based on multiple related entities.
Most of the validation models Spring Validation, JSR303 are specifically targeted at validation of bean's attributes. But we need something that would go across beans.
Our requirements are to come up with a method of validating a model state while externalizing validation logic out of the java code.
In the above definition a Bean is just a POJO, and a model is a collection of related Beans. So, for example, if Account has a collection of Addresses and the Account.countryOfResidence is set to USA, I would like to have a validation rule that will ensure that all Addresses have a country of USA in them.
So during the "operation" of adding an Address to the Account, a validation would kick off ensuring that Address.country is the same as Account.countryOfResidence.
We were looking into DRULES, but wanted to see if there were other options available.
Any suggestions on how to proceed?