When a java.util.Map is audited, putting a null value (with a non-null key) leads to an exception when the revision is persisted. Putting null values into maps is supported by Hibernate (see
HHH-772 Closed ). Furthermore, when the schema is generated by Hibernate the audit table has a NOT NULL constraint on the value column. The Exception stack trace that occured when trying to put a null value in an audited map (with a schema that allows null values in the corresponding column):
java.lang.NullPointerException
at org.hibernate.envers.internal.entities.mapper.relation.component.MiddleSimpleComponentMapper.mapToObjectFromFullMap(MiddleSimpleComponentMapper.java:33)
at org.hibernate.envers.internal.entities.mapper.relation.lazy.initializor.MapCollectionInitializor.addToCollection(MapCollectionInitializor.java:73)
at org.hibernate.envers.internal.entities.mapper.relation.lazy.initializor.MapCollectionInitializor.addToCollection(MapCollectionInitializor.java:25)
at org.hibernate.envers.internal.entities.mapper.relation.lazy.initializor.AbstractCollectionInitializor.initialize(AbstractCollectionInitializor.java:54)
at org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.MapProxy.checkInit(MapProxy.java:34)
at org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.MapProxy.get(MapProxy.java:64)
at ...
|