mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-12-27 19:07:28 +00:00
Add validation to Owner telephone field
Signed-off-by: kriti20041 <kritia2004@gmail.com>
This commit is contained in:
parent
fd4361b118
commit
7b9760c42e
1 changed files with 3 additions and 0 deletions
|
|
@ -82,6 +82,9 @@ public class Owner extends Person {
|
|||
this.city = city;
|
||||
}
|
||||
|
||||
@NotBlank
|
||||
@Pattern(regexp = "\\d{10}", message = "Telephone must be a 10-digit number")
|
||||
@Column(name = "telephone")
|
||||
public String getTelephone() {
|
||||
return this.telephone;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue