Skip to content

Commit 5f41b40

Browse files
committed
HHH-17257 ElementCollection is missing elements after update if embeddable type has primitive columns marked as nullable
1 parent bd19df1 commit 5f41b40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddableMappingTypeImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,15 @@ private boolean finishInitialization(
385385
length = column.getLength();
386386
precision = column.getPrecision();
387387
scale = column.getScale();
388-
nullable = column.isNullable();
388+
nullable = bootPropertyDescriptor.isOptional() && column.isNullable() ;
389389
selectablePath = basicValue.createSelectablePath( column.getQuotedName( dialect ) );
390390
}
391391
else {
392392
columnDefinition = null;
393393
length = null;
394394
precision = null;
395395
scale = null;
396-
nullable = true;
396+
nullable = bootPropertyDescriptor.isOptional();
397397
selectablePath = basicValue.createSelectablePath( bootPropertyDescriptor.getName() );
398398
}
399399
attributeMapping = MappingModelCreationHelper.buildBasicAttributeMapping(

0 commit comments

Comments
 (0)