HHH-4911 render referencedColumnName case insensitive
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18794 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
8514f5a15e
commit
b3dca5d4d6
|
@ -439,7 +439,7 @@ public class BinderHelper {
|
|||
return persistentClass; //shortcut for implicit referenced column names
|
||||
}
|
||||
PersistentClass current = persistentClass;
|
||||
Object result = null;
|
||||
Object result;
|
||||
boolean found = false;
|
||||
do {
|
||||
result = current;
|
||||
|
|
|
@ -54,7 +54,8 @@ public class CopyIdentifierComponentSecondPass implements SecondPass {
|
|||
if ( referencedColumnName == null || BinderHelper.isDefault( referencedColumnName ) ) {
|
||||
break;
|
||||
}
|
||||
columnByReferencedName.put( referencedColumnName, joinColumn );
|
||||
//JPA 2 requires referencedColumnNames to be case insensitive
|
||||
columnByReferencedName.put( referencedColumnName.toLowerCase(), joinColumn );
|
||||
}
|
||||
//try default column orientation
|
||||
int index = 0;
|
||||
|
@ -103,7 +104,8 @@ public class CopyIdentifierComponentSecondPass implements SecondPass {
|
|||
if ( isExplicitReference ) {
|
||||
final String columnName = column.getName();
|
||||
logicalColumnName = mappings.getLogicalColumnName( columnName, referencedPersistentClass.getTable() );
|
||||
joinColumn = columnByReferencedName.get( logicalColumnName );
|
||||
//JPA 2 requires referencedColumnNames to be case insensitive
|
||||
joinColumn = columnByReferencedName.get( logicalColumnName.toLowerCase() );
|
||||
}
|
||||
else {
|
||||
joinColumn = columnByReferencedName.get( "" + index );
|
||||
|
|
|
@ -564,7 +564,7 @@ public class Ejb3JoinColumn extends Ejb3Column {
|
|||
for (Ejb3JoinColumn ejb3Column : columns) {
|
||||
String logicalReferencedColumnName = ejb3Column.getReferencedColumn();
|
||||
if ( StringHelper.isNotEmpty( logicalReferencedColumnName ) ) {
|
||||
String referencedColumnName = null;
|
||||
String referencedColumnName;
|
||||
try {
|
||||
referencedColumnName = mappings.getPhysicalColumnName( logicalReferencedColumnName, matchingTable );
|
||||
}
|
||||
|
|
|
@ -443,7 +443,8 @@ public class TableBinder {
|
|||
for (Ejb3JoinColumn joinCol : columns) {
|
||||
String referencedColumn = joinCol.getReferencedColumn();
|
||||
referencedColumn = mappings.getPhysicalColumnName( referencedColumn, table );
|
||||
if ( referencedColumn.equals( col.getName() ) ) {
|
||||
//In JPA 2 referencedColumnName is case insensitive
|
||||
if ( referencedColumn.equalsIgnoreCase( col.getName() ) ) {
|
||||
//proper join column
|
||||
if ( joinCol.isNameDeferred() ) {
|
||||
joinCol.linkValueUsingDefaultColumnNaming(
|
||||
|
|
|
@ -22,7 +22,7 @@ public class Dependent {
|
|||
|
||||
@MapsId("empPK")
|
||||
@JoinColumns({
|
||||
@JoinColumn(name = "FK1", referencedColumnName = "firstName"),
|
||||
@JoinColumn(name = "FK1", referencedColumnName = "FIRSTNAME"),
|
||||
@JoinColumn(name = "FK2", referencedColumnName = "lastName")
|
||||
})
|
||||
@ManyToOne
|
||||
|
|
Loading…
Reference in New Issue