HHH-4647 Problems with @JoinColumn referencedColumnName and quoted column and table names

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19432 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Sharath Reddy 2010-05-09 18:19:56 +00:00
parent b4fa90a58b
commit 91cbdb8177
1 changed files with 9 additions and 3 deletions

View File

@ -2722,7 +2722,7 @@ public class Configuration implements Serializable {
} }
binding.addBinding( logicalName, physicalColumn ); binding.addBinding( logicalName, physicalColumn );
} }
public String getPhysicalColumnName(String logicalName, Table table) throws MappingException { public String getPhysicalColumnName(String logicalName, Table table) throws MappingException {
logicalName = logicalName.toLowerCase(); logicalName = logicalName.toLowerCase();
String finalName = null; String finalName = null;
@ -2733,12 +2733,15 @@ public class Configuration implements Serializable {
finalName = ( String ) binding.logicalToPhysical.get( logicalName ); finalName = ( String ) binding.logicalToPhysical.get( logicalName );
} }
String key = buildTableNameKey( String key = buildTableNameKey(
currentTable.getSchema(), currentTable.getCatalog(), currentTable.getName() currentTable.getQuotedSchema(), currentTable.getCatalog(), currentTable.getQuotedName()
); );
TableDescription description = ( TableDescription ) tableNameBinding.get( key ); TableDescription description = ( TableDescription ) tableNameBinding.get( key );
if ( description != null ) { if ( description != null ) {
currentTable = description.denormalizedSupertable; currentTable = description.denormalizedSupertable;
} }
else {
currentTable = null;
}
} while ( finalName == null && currentTable != null ); } while ( finalName == null && currentTable != null );
if ( finalName == null ) { if ( finalName == null ) {
@ -2759,12 +2762,15 @@ public class Configuration implements Serializable {
logical = ( String ) binding.physicalToLogical.get( physicalName ); logical = ( String ) binding.physicalToLogical.get( physicalName );
} }
String key = buildTableNameKey( String key = buildTableNameKey(
currentTable.getSchema(), currentTable.getCatalog(), currentTable.getName() currentTable.getQuotedSchema(), currentTable.getCatalog(), currentTable.getQuotedName()
); );
description = ( TableDescription ) tableNameBinding.get( key ); description = ( TableDescription ) tableNameBinding.get( key );
if ( description != null ) { if ( description != null ) {
currentTable = description.denormalizedSupertable; currentTable = description.denormalizedSupertable;
} }
else {
currentTable = null;
}
} }
while ( logical == null && currentTable != null && description != null ); while ( logical == null && currentTable != null && description != null );
if ( logical == null ) { if ( logical == null ) {