HHH-13959 Add nullability and uniqueness for @OneToOne with @JoinTable

This commit is contained in:
Andrea Boriero 2020-04-20 17:16:26 +01:00
parent 5c92d515c6
commit 27b065c574
1 changed files with 8 additions and 1 deletions

View File

@ -3113,7 +3113,14 @@ public final class AnnotationBinder {
propertyBinder.setCascade( cascadeStrategy );
propertyBinder.setProperty( property );
propertyBinder.setXToMany( true );
propertyBinder.makePropertyAndBind();
final Property boundProperty = propertyBinder.makePropertyAndBind();
if ( joinColumn != null ) {
boundProperty.setOptional( joinColumn.nullable() && optional );
}
else {
boundProperty.setOptional( optional );
}
}
protected static void defineFetchingStrategy(ToOne toOne, XProperty property) {