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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -