So the field is modified in Java (null -> ""), but is not modified from an Oracle point of view?
As a work-around maybe you can create an @PreUpdate, @PreInsert event to set the empty-string names to nulls.
As a proper fix, I supose we should make a special-case for Oracle? Or maybe this is already somehow encapsulated in the Hibernate Dialect object, and Envers just needs to use it. Anyway, thanks for reporting the issue and please create a JIRA for that. And if you would like to contribute a fix ...
Yes that is correct. The entity is loaded and the property is set from null to empty string. The entity is then persisted. Next time the entity is loaded the field will have value null as Oracle stores empty string as null.
As the object has changed state (null -> ""), the dirty flag must be set on the entity and Hibernate adds an update to the action queue which in turn raises the PostUpdateEvent to the Envers listener.
I had a quick look at the Oracle Dialect and could not see anything of use there. It seems to be more of an issue with Hibernate not being able to recognize that null -> "" should not result in an update if an Oracle Dialect is being used, rather than something in Envers. Would you agree?
After some further googling it seems using a custom user type has been previously recommended
It seems like a lot of work to implement such a solution as we have hundreds of entities in the application.