Uploaded image for project: 'Hibernate ORM'
  1. HHH-11901

Map with null values cannot be audited

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 5.2.9
    • Fix versions: 5.2.14, 5.3.0.CR2
    • Components: hibernate-envers
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

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

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: