HHH-9805 - Backport for 4.2 branch

This commit is contained in:
Andrea Boriero 2015-05-25 18:17:54 +01:00
parent 3a4b2426fc
commit 938064fc3d
1 changed files with 7 additions and 1 deletions

View File

@ -37,6 +37,7 @@ import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula;
import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.cfg.naming.NamingStrategyDelegate;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Join;
@ -657,12 +658,17 @@ public class Ejb3JoinColumn extends Ejb3Column {
if ( StringHelper.isNotEmpty( columnName ) ) {
getMappingColumn().setName(
applyNamingStrategy ?
getNamingStrategyDelegate().toPhysicalColumnName( columnName ) :
quoteIdentifier( getNamingStrategyDelegate().toPhysicalColumnName( columnName ) ) :
columnName
);
}
}
private String quoteIdentifier(String identifier) {
return getMappings().getObjectNameNormalizer().isUseQuotedIdentifiersGlobally()
? StringHelper.quote( identifier ) : identifier;
}
public static Ejb3JoinColumn[] buildJoinTableJoinColumns(
JoinColumn[] annJoins,
Map<String, Join> secondaryTables,