Created
June 16, 2016 15:55
-
-
Save gsmet/35400a3ef424ab7fcde933b4ebe211d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3Column.java b/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3Column.java | |
index 9d5b9b9..dff3c39 100644 | |
--- a/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3Column.java | |
+++ b/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3Column.java | |
@@ -269,13 +269,9 @@ public class Ejb3Column { | |
if ( applyNamingStrategy ) { | |
if ( StringHelper.isEmpty( columnName ) ) { | |
if ( propertyName != null ) { | |
- /// HHH-6005 magic | |
- if ( propertyName.contains( ".collection&&element." ) ) { | |
- propertyName = propertyName.replace( "collection&&element.", "" ); | |
- } | |
final AttributePath attributePath = AttributePath.parse( propertyName ); | |
- final Identifier implicitName = normalizer.normalizeIdentifierQuoting( | |
+ Identifier implicitName = normalizer.normalizeIdentifierQuoting( | |
implicitNamingStrategy.determineBasicColumnName( | |
new ImplicitBasicColumnNameSource() { | |
@Override | |
@@ -299,6 +295,12 @@ public class Ejb3Column { | |
) | |
); | |
+ // HHH-6005 magic | |
+ if ( implicitName.getText().contains( ".collection&&element." ) ) { | |
+ implicitName = Identifier.toIdentifier( implicitName.getText().replace( "collection&&element.", "" ), | |
+ implicitName.isQuoted() ); | |
+ } | |
+ | |
final Identifier physicalName = physicalNamingStrategy.toPhysicalColumnName( implicitName, database.getJdbcEnvironment() ); | |
mappingColumn.setName( physicalName.render( database.getDialect() ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment