java - Hibernate duplicate entry -
i have registration table.that has many duplicate entries. here duplicate entries in terms of same username. want know how prevent duplicate entries in table. using hibernate , java servlet.
you should create unique constraint on username.
@entity @table(uniqueconstraints= @uniqueconstraint(columnnames = {"username"})) public class registration { //... }
Comments
Post a Comment