-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate 3 AssertionFailure null id in entry
PostPosted: Mon Jan 21, 2008 6:30 pm 
Newbie

Joined: Wed Jan 16, 2008 6:25 pm
Posts: 4
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.