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!