From 46c962e9b04a883e03137962b0bdb71fdcfa0c4e Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Thu, 5 Sep 2013 13:46:44 -0400 Subject: [PATCH] HHH-8468 cleanup and simplification --- .../main/java/org/hibernate/cfg/Ejb3JoinColumn.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java b/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java index 0400f9bff0..90c415f671 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java @@ -256,7 +256,8 @@ public class Ejb3JoinColumn extends Ejb3Column { ); } 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 ); @@ -265,7 +266,6 @@ public class Ejb3JoinColumn extends Ejb3Column { joinColumn.setPropertyHolder( propertyHolder ); joinColumn.setPropertyName( BinderHelper.getRelativePath( propertyHolder, propertyName ) ); joinColumn.setImplicit( false ); - joinColumn.setMappings( mappings ); joinColumn.bind(); return joinColumn; } @@ -293,13 +293,13 @@ public class Ejb3JoinColumn extends Ejb3Column { // 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() ); @@ -309,7 +309,7 @@ public class Ejb3JoinColumn extends Ejb3Column { 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 ); } } @@ -679,7 +679,7 @@ public class Ejb3JoinColumn extends Ejb3Column { 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();