Announcement Announcement Module
No announcement yet.
Annotation Validation - Add vs Update Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Annotation Validation - Add vs Update

    Hi all, still pretty new to Spring and had a question about using annotated validation. I was able to write my own contraint on a property named "sportName" that checks to see if it already exists in the database or not, if it does tell the user it already exists. This works great when adding new sports, however if I try to edit a sport but keep the sportName the same, it returns an error as well.

    Is it possible to pass in a sportID (or any parameter for that matter) in my custom constraint for sportName so that the validator won't return false if sportName is already in the database but the sportID matches the currently sportID currently being edited?

    Or is there a better way of doing this?