mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-25 21:04:51 +00:00
HHH-13241 : Fix regression with an uninitialized null many-to-one association
(cherry picked from commit b28dc488a11f580ebb8128d620cc01646d832343)
This commit is contained in:
parent
b98d78b2ad
commit
2e698d4744
@ -100,6 +100,11 @@ else if ( type.isEntityType() ) {
|
||||
// If value is lazy, it may need to be initialized to
|
||||
// determine if the value is nullifiable.
|
||||
final Object possiblyInitializedValue = initializeIfNecessary( value, propertyName, entityType );
|
||||
if ( possiblyInitializedValue == null ) {
|
||||
// The uninitialized value was initialized to null
|
||||
returnedValue = null;
|
||||
}
|
||||
else {
|
||||
// If the value is not nullifiable, make sure that the
|
||||
// possibly initialized value is returned.
|
||||
returnedValue = isNullifiable( entityType.getAssociatedEntityName(), possiblyInitializedValue )
|
||||
@ -107,6 +112,7 @@ else if ( type.isEntityType() ) {
|
||||
: possiblyInitializedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( type.isAnyType() ) {
|
||||
returnedValue = isNullifiable( null, value ) ? null : value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user