title: How to create a constraint validator for multiple fields through annotation in spring 4.*
body: <p>How to create a validator restrictions for more fields through annotation in spring 4.* for example </p>
  
  <blockquote>
    <p>@UniqueValidator</p>
  </blockquote>
  
  <pre><code>@Entity
  @Table(name = "persons")
  @UniqueValidator(message="Peson already exist",columns={"name","lastName"})
  public class {
      @Column
      private String name;
      @Column
      private String lastName;
  }
  </code></pre>
  
  <p>roughly speaking..</p>
  
  <pre><code>select ... from persons where name='qwerty' and lastName='asdfgh'
  </code></pre>