1 Reply Latest reply on Oct 11, 2007 1:39 AM by Matt Drees

    Object Level Validation

    Stuart Douglas Master

      Is it possible to do object level validation in Seam? e.g. I have an @AssertTrue on one of my entities and I was wondering if there was a easy way to perform validation based on this.
      At the moment I am having to roll my own, which is less than optimal.

        • 1. Re: Object Level Validation
          Matt Drees Master

          No, I don't think so. It'd be tough to do.

          As I understand it, if the validate values phase fails, then the update models phase should be skipped. But @AssertTrue methods are only going to be useful if the model attributes have been updated. So you can't check @AssertTrue methods in the validate values phase.

          With property-level validation, you can check whether a value is valid without actually setting the property, so normal Model Validation doesn't have this problem.