-->
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: Many-to-Many With sql-delete: Don't delete lookup references
PostPosted: Tue Nov 06, 2007 8:59 pm 
Newbie

Joined: Tue Nov 06, 2007 8:47 pm
Posts: 1
Greetings,

I've been doing some digging through the forums to try to solve a problem we are currently having with our Hibernate configuration.

We have two entities (lets say EntityA and EntityB) with a many-to-many relationship. Each entity has an <sql-delete> that doesn't actually delete the record, just flips a "visible" flag in the database.

Currently, we have EntityA be the owning side of the relationship (it has inverse="false"), however, we are finding that when using this configuration, when we "delete" EntityA, it will go and remove the record from the lookup table, and this really isn't what we want.

I saw another forum post:

tenwit wrote:
I hadn't realized that the problem was with the join table. Normally, there's no issue with that. There's no need for any cascade to be specified in this case: hibernate always deletes the join rows from tables specified in the table="" attribute of a collection mapping. The cascade="" part applies to the collection rows, not the join rows.


I'm curious if there is a way for us to stop the functionality of Hibernate removing the join rows of the table? Basically, we'd like to have the equivalent of an <sql-delete> on the lookup table that doesn't remove anything.

I'm still quite new to Hibernate so I'd really appreciate any input/explanations into this behaviour. Thank you!


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.