Hibernate version: 3.2
Name and version of the database you are using: Oracle
I've been asked to implement i18n of some data columns.
I'm looking at using interceptors, event listeners, etc, in Hibernate to do this.
Briefly, we've created a new Translation table, which has columns like EntityName, EntityId, PropertyName.
If a column being updated appears in the registry of translatable columns then our Hibernate EventListener inserts/updates a row in the Translation table.
This works fine. The Translation table seems to be maintained correctly.
My question is, if I want the original table to retain the native translation, which will be for the en_AU locale, how do I get Hibernate to exclude various properties from update statements?
I've been playing around with specifying a persister attribute in my mapping <class> definition, where the persister is a subclass of org.hibernate.persister.entity.SingleTableEntityPersister but feel like i'm banging my head against the wall a bit.
Specifically, I've tried to override the update method, and thought I could possibly modify the boolean[] includeProperty array but the SQL statement for the update has already been built at this time so its the wrong spot to override.
Any ideas?
Is there some nice excludePropertyFromUpdate() template method I can override somewhere?
|