-->
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: Hibnerate and foreign keys
PostPosted: Tue Oct 21, 2008 1:59 pm 
Newbie

Joined: Mon Nov 14, 2005 5:17 am
Posts: 13
Hey,

I have an entity ("entrylog") that represents a log entry in the app,

entrylog has a reference to other entities.


When hibernate creates the tables, it also creates the foreign keys, thus, when I delete a certain entity that is associated with an entrylog, I get:


Code:
Cannot delete or update a parent row: a foreign key constraint fails


Usually it makes sense, but in my case, since the entrylog is just a log entry, I would like to be able to delete entries (that associated to the entrylog) and leave the log entry as they are.

Is it possible? I don't mind that the entrylog will keep a reference to a not existance entry, I will take care of it programatically.


Thanks in advance,


Asaf


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.