HHH-8468 cleanup and simplification
This commit is contained in:
parent
e22bd63648
commit
fe51ad9e29
|
@ -256,7 +256,8 @@ public class Ejb3JoinColumn extends Ejb3Column {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Ejb3JoinColumn joinColumn = new Ejb3JoinColumn();
|
Ejb3JoinColumn joinColumn = new Ejb3JoinColumn();
|
||||||
joinColumn.setJoinAnnotation( ann, null, mappings );
|
joinColumn.setMappings( mappings );
|
||||||
|
joinColumn.setJoinAnnotation( ann, null );
|
||||||
if ( StringHelper.isEmpty( joinColumn.getLogicalColumnName() )
|
if ( StringHelper.isEmpty( joinColumn.getLogicalColumnName() )
|
||||||
&& ! StringHelper.isEmpty( suffixForDefaultColumnName ) ) {
|
&& ! StringHelper.isEmpty( suffixForDefaultColumnName ) ) {
|
||||||
joinColumn.setLogicalColumnName( propertyName + suffixForDefaultColumnName );
|
joinColumn.setLogicalColumnName( propertyName + suffixForDefaultColumnName );
|
||||||
|
@ -265,7 +266,6 @@ public class Ejb3JoinColumn extends Ejb3Column {
|
||||||
joinColumn.setPropertyHolder( propertyHolder );
|
joinColumn.setPropertyHolder( propertyHolder );
|
||||||
joinColumn.setPropertyName( BinderHelper.getRelativePath( propertyHolder, propertyName ) );
|
joinColumn.setPropertyName( BinderHelper.getRelativePath( propertyHolder, propertyName ) );
|
||||||
joinColumn.setImplicit( false );
|
joinColumn.setImplicit( false );
|
||||||
joinColumn.setMappings( mappings );
|
|
||||||
joinColumn.bind();
|
joinColumn.bind();
|
||||||
return joinColumn;
|
return joinColumn;
|
||||||
}
|
}
|
||||||
|
@ -293,13 +293,13 @@ public class Ejb3JoinColumn extends Ejb3Column {
|
||||||
|
|
||||||
|
|
||||||
// TODO default name still useful in association table
|
// TODO default name still useful in association table
|
||||||
public void setJoinAnnotation(JoinColumn annJoin, String defaultName, Mappings mappings) {
|
public void setJoinAnnotation(JoinColumn annJoin, String defaultName) {
|
||||||
if ( annJoin == null ) {
|
if ( annJoin == null ) {
|
||||||
setImplicit( true );
|
setImplicit( true );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setImplicit( false );
|
setImplicit( false );
|
||||||
final ObjectNameNormalizer nameNormalizer = mappings.getObjectNameNormalizer();
|
final ObjectNameNormalizer nameNormalizer = getMappings().getObjectNameNormalizer();
|
||||||
if ( !BinderHelper.isEmptyAnnotationValue( annJoin.columnDefinition() ) ) setSqlType( annJoin.columnDefinition() );
|
if ( !BinderHelper.isEmptyAnnotationValue( annJoin.columnDefinition() ) ) setSqlType( annJoin.columnDefinition() );
|
||||||
if ( !BinderHelper.isEmptyAnnotationValue( annJoin.name() ) ) setLogicalColumnName( annJoin.name() );
|
if ( !BinderHelper.isEmptyAnnotationValue( annJoin.name() ) ) setLogicalColumnName( annJoin.name() );
|
||||||
setNullable( annJoin.nullable() );
|
setNullable( annJoin.nullable() );
|
||||||
|
@ -309,7 +309,7 @@ public class Ejb3JoinColumn extends Ejb3Column {
|
||||||
setReferencedColumn( annJoin.referencedColumnName() );
|
setReferencedColumn( annJoin.referencedColumnName() );
|
||||||
|
|
||||||
final String tableName = !BinderHelper.isEmptyAnnotationValue( annJoin.table() )
|
final String tableName = !BinderHelper.isEmptyAnnotationValue( annJoin.table() )
|
||||||
? nameNormalizer.normalizeIdentifierQuoting( mappings.getNamingStrategy().tableName( annJoin.table() ) ) : "";
|
? nameNormalizer.normalizeIdentifierQuoting( getMappings().getNamingStrategy().tableName( annJoin.table() ) ) : "";
|
||||||
setSecondaryTableName( tableName );
|
setSecondaryTableName( tableName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -679,7 +679,7 @@ public class Ejb3JoinColumn extends Ejb3Column {
|
||||||
currentJoinColumn.setMappings( mappings );
|
currentJoinColumn.setMappings( mappings );
|
||||||
currentJoinColumn.setPropertyName( BinderHelper.getRelativePath( propertyHolder, propertyName ) );
|
currentJoinColumn.setPropertyName( BinderHelper.getRelativePath( propertyHolder, propertyName ) );
|
||||||
currentJoinColumn.setMappedBy( mappedBy );
|
currentJoinColumn.setMappedBy( mappedBy );
|
||||||
currentJoinColumn.setJoinAnnotation( annJoin, propertyName, mappings );
|
currentJoinColumn.setJoinAnnotation( annJoin, propertyName );
|
||||||
currentJoinColumn.setNullable( false ); //I break the spec, but it's for good
|
currentJoinColumn.setNullable( false ); //I break the spec, but it's for good
|
||||||
//done after the annotation to override it
|
//done after the annotation to override it
|
||||||
currentJoinColumn.bind();
|
currentJoinColumn.bind();
|
||||||
|
|
Loading…
Reference in New Issue