I'm starting to do some simple validation. I see how to add annotations to individual properties, and how to add new annotations that would be useful across multiple objects. But I need to validate the entire state of an object. The first test is the uniqueness of an object on a database. This is not limited to a single field, rather multiple.
I tried creating a new validation method on the class, and put an @AssertTrue on it. But I think hibernate is treating that like it's a property rather than simply a validation method.
Is there a good way to validate an entire object when it's saved, rather than individual fields?
Thanks,
Norman
|