From 3001b7f01d2404b9116d405075f77a1f23d24677 Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Wed, 14 Aug 2024 15:59:13 +0200 Subject: [PATCH] HHH-18484 Account for null generated values for no-op updates --- .../metamodel/mapping/internal/GeneratedValuesProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java index f7e0b4e07e..d0882cbe36 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java @@ -153,8 +153,8 @@ public class GeneratedValuesProcessor { assert results.size() == 1; setEntityAttributes( entity, state, results.get( 0 ) ); } - else { - castNonNull( generatedValues ); + else if ( generatedValues != null ) { + // can be null when an update action resulted in a no-op (e.g. only changes to unowned association) final List results = generatedValues.getGeneratedValues( generatedValuesToSelect ); setEntityAttributes( entity, state, results.toArray( new Object[0] ) ); }