fix disabling of fk in @ManyToOne associations
This commit is contained in:
parent
abe0cc3108
commit
6bfa8d6c27
|
@ -84,7 +84,7 @@ public class ManyToOne extends ToOne {
|
||||||
( (Component) property.getValue() ).sortProperties();
|
( (Component) property.getValue() ).sortProperties();
|
||||||
}
|
}
|
||||||
// todo : if "none" another option is to create the ForeignKey object still but to set its #disableCreation flag
|
// todo : if "none" another option is to create the ForeignKey object still but to set its #disableCreation flag
|
||||||
if ( !hasFormula() && !"none".equals( getForeignKeyName() ) ) {
|
if ( isForeignKeyEnabled() && !hasFormula() ) {
|
||||||
ForeignKey fk = getTable().createForeignKey(
|
ForeignKey fk = getTable().createForeignKey(
|
||||||
getForeignKeyName(),
|
getForeignKeyName(),
|
||||||
getConstraintColumns(),
|
getConstraintColumns(),
|
||||||
|
|
|
@ -1595,7 +1595,7 @@ public class MappingModelCreationHelper {
|
||||||
}
|
}
|
||||||
else if ( fetchStyle == FetchStyle.JOIN
|
else if ( fetchStyle == FetchStyle.JOIN
|
||||||
|| !lazy
|
|| !lazy
|
||||||
|| ( value instanceof OneToOne && value.isNullable() )
|
|| value instanceof OneToOne && value.isNullable()
|
||||||
|| value instanceof ManyToOne && value.isNullable() && ( (ManyToOne) value ).isIgnoreNotFound() ) {
|
|| value instanceof ManyToOne && value.isNullable() && ( (ManyToOne) value ).isIgnoreNotFound() ) {
|
||||||
fetchTiming = FetchTiming.IMMEDIATE;
|
fetchTiming = FetchTiming.IMMEDIATE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,7 +369,7 @@ public abstract class AbstractPropertyMapping implements PropertyMapping {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (! etype.isNullable() ) && idPropName != null ) {
|
if ( !etype.isNullable() && idPropName != null ) {
|
||||||
String idpath2 = extendPath( path, idPropName );
|
String idpath2 = extendPath( path, idPropName );
|
||||||
addPropertyPath( idpath2, idtype, columns, columnReaders, columnReaderTemplates, formulaTemplates, factory );
|
addPropertyPath( idpath2, idtype, columns, columnReaders, columnReaderTemplates, formulaTemplates, factory );
|
||||||
initPropertyPaths( idpath2, idtype, columns, columnReaders, columnReaderTemplates, formulaTemplates, factory );
|
initPropertyPaths( idpath2, idtype, columns, columnReaders, columnReaderTemplates, formulaTemplates, factory );
|
||||||
|
@ -397,7 +397,8 @@ public abstract class AbstractPropertyMapping implements PropertyMapping {
|
||||||
final String[] columns,
|
final String[] columns,
|
||||||
final String[] columnReaders,
|
final String[] columnReaders,
|
||||||
final String[] columnReaderTemplates,
|
final String[] columnReaderTemplates,
|
||||||
String[] formulaTemplates, final Mapping factory) throws MappingException {
|
final String[] formulaTemplates,
|
||||||
|
final Mapping factory) throws MappingException {
|
||||||
|
|
||||||
Type[] types = type.getSubtypes();
|
Type[] types = type.getSubtypes();
|
||||||
String[] properties = type.getPropertyNames();
|
String[] properties = type.getPropertyNames();
|
||||||
|
|
Loading…
Reference in New Issue