Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » View as JoinTable causes delete problem
View as JoinTable causes delete problem [message #903670] Fri, 24 August 2012 20:06 Go to next message
Jeremy Purdy is currently offline Jeremy PurdyFriend
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"/>

This works fine for queries, etc.

However, when I attempt to delete a FOO object, eclipselink is cascading the delete into the view:
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?
Re: View as JoinTable causes delete problem [message #903998 is a reply to message #903670] Mon, 27 August 2012 14:17 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1369
Registered: July 2009
Senior Member
I assumed that marking all fields as insertable=false, updatable=false would make the mapping read only, but it looks like you will need to use a customizer to get the mapping and mark it directly using the setIsReadOnly(true) method.

Descriptor customizers are described here:

with the following code being required:

Best Regards,

[Updated on: Mon, 27 August 2012 14:29]

Report message to a moderator

Previous Topic:Problem in running QueryHints.READ_ONLY on GF 3.0
Next Topic:merging returns old value for referenced entity
Goto Forum:

Current Time: Wed Sep 23 04:47:46 GMT 2020

Powered by FUDForum. Page generated in 0.01597 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top