From c67b3f984a0e711e4337492102e1c6035390d659 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Tue, 29 Nov 2022 16:43:02 +0100 Subject: [PATCH] HHH-15741 Explicit declaration assigned identifier generator does not work --- .../src/main/java/org/hibernate/cfg/BinderHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/BinderHelper.java b/hibernate-core/src/main/java/org/hibernate/cfg/BinderHelper.java index d63d2c2732..f9f5fbcb93 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/BinderHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/BinderHelper.java @@ -787,6 +787,9 @@ public class BinderHelper { || identifierGeneratorStrategy.equals( "seqhilo" ); if ( generatorType == null || !avoidOverriding ) { id.setIdentifierGeneratorStrategy( identifierGeneratorStrategy ); + if ( identifierGeneratorStrategy.equals( "assigned" ) ) { + id.setNullValue( "undefined" ); + } } //checkIfMatchingGenerator(definition, generatorType, generatorName); parameters.putAll( definition.getParameters() );