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
Post a Comment