• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

modification in chapter 12 validatingLifecycle

 
Ranch Hand
Posts: 1749
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In chapter 12, validatingLifecycle example,


I modified this to make the example easier to understand:



I first add id=10, name=Jason, vacation= 111 to the database.
Then, when I remove Jason, it throws an exception like this:


javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'preRemove'



Then, I update Jason's vacation = 1.
Then, I remove Jason. It works.
When Jason is removed from the front-end, the automated validation occurs before Jason is removed without exception.
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!