Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NOT NULL FK nullification problem(incompatible side-effect of shallow update/delete behavior on FKs defined in existing schema)
NOT NULL FK nullification problem [message #1243377] Mon, 10 February 2014 23:02
Thom Park is currently offline Thom ParkFriend
Messages: 12
Registered: June 2012
Junior Member
Is there any way to suppress eclipselink's shallow update/delete behavior where it nulls any foreign keys detected for a particular mapped entity?

By way of explanation:

I have a mature existing schema that is accessed via JDBC and eclipselink (2.0.2) clients.
Ideally, I'd like to bring the eclipselink portion up to the very latest release as a stepping stone to enabling JPA compliant behavior. However I've encountered a bit of an issue.

Eclipselink 2.5.1 nulls out any Foreign keys in a parent entity if a cyclic relationship is detected (basically prior to performing the delete or update operation on the child/related entities).

My problem is two-fold:

  1. Not all FKs contribute to the cyclic relationship
  2. Some of the FKs are defined as not-null in order to maintain a mandatory relationship (1:1 as opposed to 0:1)

The not null constraint is needed to enforce integrity for the JDBC clients rather than the eclipselink clients, but since the database schema is shared, I can't just relax the constraint without risking issues.

So - is there any way to suppress the nullification of the FKs in eclipselink?

I did see seem code in the OneToOneMapping implementation that appeared to check to see if the underlying column was nullable but that doesn't appear to have any bearing on the generation of the update statement that nulls out the foreign-key in the table.

Any thoughts out there on how best to fix this?
(either with eclipse link mapping or otherwise)?

Note: This application is still using TopLInk-style mappings, not JPA annotations - I'm unable to move to JPA just yet, hence the attempt to bring the release up to 2.5.1.

Previous Topic:DynamicJAXBContextFactory.createContextFromXSD fails to load SchemaMetadata
Next Topic:Saving a referenced existing entity results in a new entity
Goto Forum:

Current Time: Wed Apr 01 05:56:46 GMT 2020

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

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

Back to the top