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: Null values not allowed in foreign composite keys.
PostPosted: Mon Apr 28, 2008 6:47 am 
Newbie

Joined: Thu Apr 10, 2008 8:53 am
Posts: 3
SOLVED. It turned a change to some triggers in the database was the cause.

Hi,

I have a problem getting NHibernate to accept null values in my foreign composite keys.

I have a hierarchy where each object is linked to its parent(ForgaengerTekniskPladsID / ForgaengerGyldigFra) and the topmost item in the hierarchy should have the parent keys set to null.

When I set the parent keys to existing values in the database it runs smoothly, but when I set the predecessor keys to null, I get this error:

NHibernate.Util.ADOExceptionReporter Cannot insert/update into table "TekniskPladsSetup" because the values entered for "ForgaengerTekniskPladsID", "ForgaengerGyldigFraDato" in "TekniskPladsSetup" must correspond to the values of primary key column(s) of the table "TekniskPladsSetup".

I have looked around for some hours now and googled to no avail. (Nothing with that error message can be found on google).

Do you know what I'm doing wrong, or do you have any suggestions for what I can try to make it work?

I'm confident it's not an issue with the database since this works with the existing data layer.

Thanks in advance.

/Kim


Hibernate version:
1.2.1.4000


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.