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

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

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

java - Cannot secure connection using TLS -