onSave « Interceptor « JPA Q&A





1. Is onSave (Interceptor callback) called for cascaded objs?    forum.hibernate.org

It doesn't look like onSave gets called for userxref below. Note that userxref is a composite-element used for extra cols in a many-to-many. Should onSave get called? Or must I loop thru the collection (roles) myself, knowing that if this user is new then all the UserRole's are by default new? Jeff Code: roleA = new Role( new Long (1), "Role ...

2. Interceptor difference between onFlushDirty and onSave    forum.hibernate.org

Was wondering what the difference is between onFlushDirty and onSave. Is onFlushDirty called anytime an object's fields are written to the database (SQL update and insert) and onSave is only called the first time a newly instantiated object is persisted (SQL update only)? And if so, does that mean that onFlushDirty is also called anytime that onSave is called? Thanks.

3. Interceptor onSave not working, onSave + onFlushDirty works    forum.hibernate.org

I have an Hibernate Interceptor setting audit info on pojos, two atributes for save and other two for updates. It looks working fine, but when an object only passes by onSave method, the save audit columns are not being inserted. If the object passes by onSave and onFlushDirty, both save and update audit columns are being inserted. My interceptor extends EmptyInterceptor ...