save « Interceptor « JPA Q&A





1. Auditable; can I save a copy from an Interceptor?    forum.hibernate.org

I would like to implement Auditable so that each time a record is modified a new copy is saved. I tried the following with interceptor and long sessions: - from isUnsaved return true for all Auditables, then clear the id from onFlushDirty: isUnsaved() was not called for the entity i passed to the long session's saveOrUpdate(?!), several others were passed... also ...

2. Distinguish Save and Update in Interceptor    forum.hibernate.org

After digging into HiA Auditable interceptor example, I guess onFlushDirty is where I can handle the "UPDATE" object, where onSave only for "INSERT" object. Am I right? Also the JavaDoc of the two method seems indicating that these two methods are called in totally different place. onFlushDirty is called during session flush. I.e. session.update(object) doesn't invoke onFlushDirty method on a session ...

3. Interceptor save()? Please assist.    forum.hibernate.org