Hibernate version: 3.2.6.ga
Hi,
I have a User object that contains some attributes that are persistent to my Oracle DB and some that are persistent to my LDAP server. I've created a LdapInterceptor class (sublcass of EmptyInterceptor) and overridden the onFlushDirty() method so persist the LDAP attributes.
This works fine as long as you change one of the Oracle persisted attributes, from which Hibernate can tell that the entity is dirty. However the LDAP attributes are marked as @Transient and so if you only change one of those attributes Hibernate does not know that the entity is dirty and onFlushDirty() does not get called.
How can I ensure onFlushDirty() is called if only the LDAP attributes are changed?
As an aside, the neat thing about the Interceptor mechanism is that (in theory) there is only one representation of a User in the system and Hibernate (again in theory) maintains the two data stores via the Interceptor. Do people think this way of doing it is a good idea and has anyone got a better idea?
Thanks & Regards
Ted
|