HHH-10360 : Natural ID columns are nullable by default
(cherry picked from commit10a035481d
) (cherry picked from commit532b63042c
)
This commit is contained in:
parent
4b253dfad7
commit
1655f4556a
|
@ -1882,7 +1882,7 @@ public class ModelBinder {
|
|||
sourceDocument,
|
||||
attributeSource.getRelationalValueSources(),
|
||||
value,
|
||||
true,
|
||||
attributeSource.areValuesNullableByDefault(),
|
||||
new RelationalObjectBinder.ColumnNamingDelegate() {
|
||||
@Override
|
||||
public Identifier determineImplicitName(LocalMetadataBuildingContext context) {
|
||||
|
|
|
@ -171,7 +171,10 @@ class SingularAttributeSourceBasicImpl
|
|||
|
||||
@Override
|
||||
public boolean areValuesNullableByDefault() {
|
||||
return ! Helper.getValue( propertyElement.isNotNull(), false );
|
||||
return ! Helper.getValue(
|
||||
propertyElement.isNotNull(),
|
||||
naturalIdMutability != NaturalIdMutability.NOT_NATURAL_ID
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -216,7 +216,7 @@ class SingularAttributeSourceManyToOneImpl
|
|||
|
||||
@Override
|
||||
public boolean areValuesNullableByDefault() {
|
||||
return true;
|
||||
return getNaturalIdMutability() == NaturalIdMutability.NOT_NATURAL_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue