Skip to content

Commit

Permalink
HHH-8468 cleanup and simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
brmeyer committed Sep 5, 2013
1 parent 91a289e commit 46c962e
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -256,7 +256,8 @@ private static Ejb3JoinColumn buildJoinColumn(
);
}
Ejb3JoinColumn joinColumn = new Ejb3JoinColumn();
joinColumn.setJoinAnnotation( ann, null, mappings );
joinColumn.setMappings( mappings );
joinColumn.setJoinAnnotation( ann, null );
if ( StringHelper.isEmpty( joinColumn.getLogicalColumnName() )
&& ! StringHelper.isEmpty( suffixForDefaultColumnName ) ) {
joinColumn.setLogicalColumnName( propertyName + suffixForDefaultColumnName );
Expand All @@ -265,7 +266,6 @@ private static Ejb3JoinColumn buildJoinColumn(
joinColumn.setPropertyHolder( propertyHolder );
joinColumn.setPropertyName( BinderHelper.getRelativePath( propertyHolder, propertyName ) );
joinColumn.setImplicit( false );
joinColumn.setMappings( mappings );
joinColumn.bind();
return joinColumn;
}
Expand Down Expand Up @@ -293,13 +293,13 @@ private static Ejb3JoinColumn buildJoinColumn(


// 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 ) {
setImplicit( true );
}
else {
setImplicit( false );
final ObjectNameNormalizer nameNormalizer = mappings.getObjectNameNormalizer();
final ObjectNameNormalizer nameNormalizer = getMappings().getObjectNameNormalizer();
if ( !BinderHelper.isEmptyAnnotationValue( annJoin.columnDefinition() ) ) setSqlType( annJoin.columnDefinition() );
if ( !BinderHelper.isEmptyAnnotationValue( annJoin.name() ) ) setLogicalColumnName( annJoin.name() );
setNullable( annJoin.nullable() );
Expand All @@ -309,7 +309,7 @@ public void setJoinAnnotation(JoinColumn annJoin, String defaultName, Mappings m
setReferencedColumn( annJoin.referencedColumnName() );

final String tableName = !BinderHelper.isEmptyAnnotationValue( annJoin.table() )
? nameNormalizer.normalizeIdentifierQuoting( mappings.getNamingStrategy().tableName( annJoin.table() ) ) : "";
? nameNormalizer.normalizeIdentifierQuoting( getMappings().getNamingStrategy().tableName( annJoin.table() ) ) : "";
setSecondaryTableName( tableName );
}
}
Expand Down Expand Up @@ -679,7 +679,7 @@ public static Ejb3JoinColumn[] buildJoinTableJoinColumns(
currentJoinColumn.setMappings( mappings );
currentJoinColumn.setPropertyName( BinderHelper.getRelativePath( propertyHolder, propertyName ) );
currentJoinColumn.setMappedBy( mappedBy );
currentJoinColumn.setJoinAnnotation( annJoin, propertyName, mappings );
currentJoinColumn.setJoinAnnotation( annJoin, propertyName );
currentJoinColumn.setNullable( false ); //I break the spec, but it's for good
//done after the annotation to override it
currentJoinColumn.bind();
Expand Down

0 comments on commit 46c962e

Please sign in to comment.