title: How to merge complex business validation with JSR-303?
body: <p>I'm stuck with validation in my current use case.
  My app has standard structure (WEB &lt;-> EJB3 Services &lt;-> EJB3 DAO &lt;-> DB).
  I have an entity which has validation annotations applied to it.</p>
  
  <pre><code>@Entity
  class PhoneNumber {
  
      ...
  
      private NumberType numberType;
  }
  </code></pre>
  
  <p>where </p>
  
  <pre><code>enum NumberType {
      FIXED,
      MOBILE,
      ANY
  }
  </code></pre>
  
  <p>Now I have new validation rule to be applied. On PhoneNumber update there should be not possible to change NumberType to ANY if it was set previously to either FIXED or MOBILE. </p>
  
  <p>My Bean Validation rules are checked just before db operations, and the rule above should be applied in service layer (at least I think so) to have a DB access to get previous entity version to compare.
  But without having bean not yet validated I'm forced to check manually if e.g. numberType is not null.</p>
  
  <p>Can you please provide me some advices or general rules how to deal with more complex busines validations (not only checking single field's values in isolation) when using Bean Validation?</p>