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

NullPointerException when executing native query on an Audited Entity

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.3.2
    • Fix Version/s: 5.3.3, 5.4
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Worked in:
    • Suitable for new contributors:
      Yes, likely
    • Last commented by a user?:
      true

      Description

      Native queries stopped working after upgrade to v5.3.2.

      AbstractSharedSessionContract: Line 958 : Null check for javaType required in the newly added condition.

      Test case attached.

      Exception:
      java.lang.NullPointerException
      at org.hibernate.internal.AbstractSharedSessionContract.lambda$handleNativeQueryResult$1(AbstractSharedSessionContract.java:958)
      at java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
      at java.base/java.util.HashMap$KeySpliterator.tryAdvance(HashMap.java:1629)
      at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
      at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
      at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:528)
      at org.hibernate.internal.AbstractSharedSessionContract.handleNativeQueryResult(AbstractSharedSessionContract.java:958)
      at org.hibernate.internal.AbstractSharedSessionContract.createNativeQuery(AbstractSharedSessionContract.java:928)
      at org.hibernate.internal.AbstractSessionImpl.createNativeQuery(AbstractSessionImpl.java:23)
      at org.hibernate.bugs.JPAUnitTestCase.handleNativeQueryResult(JPAUnitTestCase.java:38)

        Attachments

          Issue links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: