Custom Insert/Update/Delete (Virsioning) [message #1022829] |
Fri, 22 March 2013 11:51  |
Eclipse User |
|
|
|
Hallo, everyone!
In my small project I use EclipseLink as a persistence framework.
The data structure is designed to use joined strategy. Besides, the entity table supports a special kind of versioning, which according to versioning methodology are:
1. One table, that holds the version numbers;
2. One common table on top of the hierarchy, that holds the entity key and two additional fields, namly creation version and deletion version.
3. Entity tables, that hold the entity attributes.
Each entity table has its own version field.
In case of the entity instance creation, one row will be created in the top table with new entity key and current version as a creation version. All entity tables in hierarchy will get one new row with current version and actual entity attributes.
In case of update only tables, which hold update attributes, will get new rows with new version.
In case of deleting only the row in the top table will be updated. The field deletion version will be updated with the current version.
The mechanism (queries) for such versioning methodology has been alredy programmed. I'm producing the simple query with the complex "where clause" to load only the row with last version.
The question is, how to substitute the apropriate Insert/Update/Delete queries with those, which instead of default operations will call specialized operations . In my case I want to substitute all update calls with insert calls; delete call with update call and so on. Is there some special solution for such cases? I would like to intercept all update calls and substitute them with appropriated insert statements.
|
|
|
|
Re: Custom Insert/Update/Delete (Virsioning) [message #1027310 is a reply to message #1027056] |
Tue, 26 March 2013 16:57  |
Eclipse User |
|
|
|
Thanks for the answer. I've looked through these links. The idea with SoftDelete is partially acceptable, but it should be realized through the DeleteQueryRedirector, while extra version number should be prepared on Databse side.
But 2 other cases (Insert/Update) don't consider the hierarchy. Under hierarchy I mean the multiple statements, which will concern in case of Update those tables with updated fields.
So, if you have another porposal, I would appriciate it.
|
|
|
Powered by
FUDForum. Page generated in 0.26973 seconds