org.hibernate.exception.ConstraintViolationException: could not insert: [eu.epsos.configmanager.database.model.Property]

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips


Check whether privilege has the "not null" restriction. If so it always has to have a value and can never be null.

A different reason could be a wrong implementation of a foreign key. Check whether you always correctly insert/update in both tables.


Nothing is wrong with the database. When it gives you those errors, it's telling you that you are trying to input "nothing" (null) into a column that doesn't allow it. Fix it by removing the not null constraint or by passing a value to that field.

Solutions on the web

via JIRA by Kostas Karkaletsis, 1 year ago
could not insert: [eu.epsos.configmanager.database.model.Property]
via Coderanch by Bharath Gowda, 1 year ago
via by Unknown author, 1 year ago
could not insert: [org.hibernate.model.Student]
via Stack Overflow by bunnyjesse112
, 2 years ago
could not insert: [entity.PurchaseOrder]
via Coderanch by shwetank singh, 1 year ago
via by Unknown author, 1 year ago
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1500000' for key 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at com.mysql.jdbc.Util.handleNewInstance(
at com.mysql.jdbc.Util.getInstance(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.sendCommand(
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
at com.mysql.jdbc.ConnectionImpl.execSQL(
at com.mysql.jdbc.PreparedStatement.executeInternal(
at com.mysql.jdbc.PreparedStatement.executeUpdate(

Users with the same issue

6 times, 6 days ago
Once, 1 week ago
5 times, 3 weeks ago
4 times, 1 month ago
2 times, 1 month ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.