title: How to use spring mvc, hibernate, hibernate validator together?
body: <p>I want to use spring mvc-hibernate-hibernate validator in my project. But in the class I applied the anotations, validation and mysql anotations are overlapping. The use of these two is normally the case. Or is it done in another way?</p>
  
  <pre><code>@Id
  @Column(name="id")
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  Integer id;
  
  @Column(name="firstname")
  @NotBlank(message="Name mustn't be empty.")
  @Size(max=20,min=2,message="Your name must be between 2-20.")
  @Pattern(regexp ="([a-zA-Z]+)",message="You can't enter number or symols or Turkish caracter.")
  String firstname;
  
  @Column(name="lastname")
  @NotBlank(message="Last name mustn't be empty.")
  @Size(max=20,min=2,message="Your lastname must be between 2-20.")
  @Pattern(regexp ="([a-zA-Z]+)",message="You can't enter number or symols or Turkish caracter.")
  String lastname;
  
  @Column(name="date")
  @NotBlank
  @DateTimeFormat(pattern="yyyy-mm-dd")
  @DateValid
  String date;
  </code></pre>