Hibernate version:3.2
Name and version of the database you are using:Mysql 4
Hi, I got a Table I want to insert data into. It's primary key is an auto increment id. Aditionally, it has a unique key, that is based on to columns.
When I try to insert a row that contains data that would violate the unique key constraint, I get an error like: AssertionFailure null id in entry
This is really weird, as this doesn't really seem to have anything to do with the unique key???
Well, I am thinking - the Hibernate Model class uses Hibernate assertions to model the table's structure, but the info of the unique key was left out (legacy code! ;-). Could this be the reason for the hard to understand error "null id in entry"? Maybe Hibernate tries an insert, doesn't expect any violation as it doesn't know of the unique key that exists on the table, then it maybe tries to retrieve the automatically generated id Integer, which can not be generated, and maybe THIS produces the error I receive?
Maybe you have an explanation that makes more sense???
Thanks in advance!
|