| View as JoinTable causes delete problem [message #903670] |
Fri, 24 August 2012 16:06  |
Jeremy Purdy Messages: 7 Registered: October 2011 |
Junior Member |
|
|
I have a one-to-many mapping that is using an Oracle view as the JoinTable because the relationship between the two objects is complex inside of the database. The mapping is here:
<one-to-many name="bars" fetch="EAGER">
<join-table name="FOO_BARS_VIEW">
<join-column name="FOOID" referenced-column-name="ID" insertable="false" updatable="false" nullable="false"/>
<inverse-join-column name="BARID" referenced-column-name="ID" insertable="false" updatable="false" nullable="false"/>
</join-table>
</one-to-many>
This works fine for queries, etc.
However, when I attempt to delete a FOO object, eclipselink is cascading the delete into the view:
DELETE FROM FOO_BARS_VIEW WHERE (FOOID = ?)
bind => [301]
This statement fails, since you can't delete from a view.
Is there a way to tell JPA not to cascade the delete into the JoinTable?
|
|
|
|
Powered by
FUDForum. Page generated in 0.01639 seconds