Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Using preInsert, preUpdate, prePersist, etc. to selectively prevent inserts and updates
Using preInsert, preUpdate, prePersist, etc. to selectively prevent inserts and updates [message #1110297] Mon, 16 September 2013 17:28
Randy Tidd is currently offline Randy TiddFriend
Messages: 8
Registered: August 2013
Junior Member
Our data model has a Statement which has many LineItems. There are numerous other entities related to both of these.

Some LineItems are derived, and we would like to have these present in memory, but don't want them stored in the database.

The merge and persist operations cascade, so any merge or persist call anywhere in the data model can trigger an insert of a LineItem if EclipseLink determines that they need to be saved. I am looking for a hook in EclipseLink where I can prevent the insert of certain LineItems.

I registered an event manager/listener and am responding to methods such as preInsert, preUpdate, prePersist, etc. These methods receive a DescriptorEvent and I am trying to figure out if I can modify the event to prevent selected inserts. I have looked for documentation describing these methods in detail, the sequence in which they are called and how to modify the event, but have not found anything, any pointers would be appreciated.

I am looking through the API in DescriptorEvent but am not seeing where I can alter the operation to eliminate certain objects, nor really am I sure if this is a supported approach for preventing selected inserts, and if there is a better way.

Any tips or examples would be greatly appreciated.

Previous Topic:one-to-many not working with interface
Next Topic:NullPointerException from moxy due to corrupted CycleDetectionStack
Goto Forum:

Current Time: Mon Mar 30 10:54:43 GMT 2020

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

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

Back to the top