Skip to content

Commit c6107ef

Browse files
committed
validation
1 parent 0e7f298 commit c6107ef

File tree

1 file changed

+5
-0
lines changed
  • src/main/java/com/liveitcourses/firstproject/dto

1 file changed

+5
-0
lines changed

‎src/main/java/com/liveitcourses/firstproject/dto/User.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
importorg.springframework.context.annotation.Bean;
44

5+
importjavax.validation.constraints.*;
6+
importjava.util.ArrayList;
57
importjava.util.Date;
68

79
publicclassUser{
810

11+
@Positive
912
privateIntegerid;
1013

14+
@Size(min = 3, max = 20, message = "Name field in User object must be between 3 and 20 chars long")
1115
privateStringname;
1216

17+
@Past
1318
privateDatebirthDate;
1419

1520
publicUser(Integerid, Stringname, DatebirthDate){

0 commit comments

Comments
(0)