Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

modification for chapter 12 validatingEntity

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, in order validate the birthday of the employee is in the past using @Valid, the code has to be modified:








If you input 118 for the year, born in 2018, you will get

Validation failed. ConstraintViolations: [ConstraintViolationImpl{interpolatedMessage='must be in the past', propertyPath=info.dob, rootBeanClass=class examples.model.Employee, messageTemplate='{javax.validation.constraints.Past.message}'}]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic