|
Hello,
What I need is functionality similar to dynamic-update and dynamic-insert but with these changes.
1. dynamic-update currently only updates properties that have changed. I would like to add an additional condition: only those properties that have changed AND do not contain a specific value (the value probably being specified in the mapping file).
2. dynamic-insert currently only inserts those properties that are not null. I would like to add the same additional condition: properties that are not null and do not contain a specific value
I first looked into implementing an Interceptor, but couldn't see how an interceptor could tell Hibernate which fields to insert or update dynamically. I've seen reports that findDirty's returned indices are ignored for dynamic updates? Also, I don't need or want to implement a dirty-finding algorithm, but I would be forced to if I took this approach. It still wouldn't help with inserts, though.
It looks like I might have to extend EntityPersister... but looking at what little docs I can find and the source for EntityPersister, this seems like a big time investment. My question: is there an easier way to do this? Or do I have to bite the bullet and implement and figure out EntityPersister?
|