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();
|
||||
}
|
||||
// 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(
|
||||
getForeignKeyName(),
|
||||
getConstraintColumns(),
|
||||
|
|
|
@ -1595,7 +1595,7 @@ public class MappingModelCreationHelper {
|
|||
}
|
||||
else if ( fetchStyle == FetchStyle.JOIN
|
||||
|| !lazy
|
||||
|| ( value instanceof OneToOne && value.isNullable() )
|
||||
|| value instanceof OneToOne && value.isNullable()
|
||||
|| value instanceof ManyToOne && value.isNullable() && ( (ManyToOne) value ).isIgnoreNotFound() ) {
|
||||
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 );
|
||||
addPropertyPath( 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[] columnReaders,
|
||||
final String[] columnReaderTemplates,
|
||||
String[] formulaTemplates, final Mapping factory) throws MappingException {
|
||||
final String[] formulaTemplates,
|
||||
final Mapping factory) throws MappingException {
|
||||
|
||||
Type[] types = type.getSubtypes();
|
||||
String[] properties = type.getPropertyNames();
|
||||
|
|
Loading…
Reference in New Issue