java - Duplicate entry for key -


i have simple entity class mappingbean

@entity @table(uniqueconstraints =@uniqueconstraint(columnnames = { "number" })) public class mappingbean { @id @generatedvalue(strategy = generationtype.identity) private int    mappingid; private string number; private string name;  ...} 

when call

entitymanager.merge(this.mapping); 

on mappingbean instance

2015-04-22 16:32:08,552 error [org.hibernate.engine.jdbc.spi.sqlexceptionhelper] (default task-15) duplicate entry '03054445441' key 'number' 2015-04-22 16:32:08,568 error [org.jboss.as.ejb3] (default task-15) javax.ejb.ejbtransactionrolledbackexception: org.hibernate.exception.constraintviolationexception: not execute statement 

what may cause exception?

best regards.

edmond


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -