fresh_dev
fresh_dev

Reputation: 6774

How to make custom validation annotation to check if object already exist?

i am using spring and hibernate validation, and i want to make a custom annotation that checks if a username already exists in the database or not, can anyone please provide me with examples for such thing ?

Upvotes: 1

Views: 8045

Answers (1)

František Hartman
František Hartman

Reputation: 15086

Here is an example of what you want (the check if email exists in database)

http://nonrepeatable.blogspot.com/2010/05/creating-custom-jsr-303-constraint.html

Upvotes: 4

Related Questions