We're updating the issue view to help you get more done. 

Map with null values cannot be audited

Description

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). 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):

1 2 3 4 5 6 7 8 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 ...

Environment

None

Status

Assignee

Chris Cranford

Reporter

Felix Feisst

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.9

Priority

Major