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

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -