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