File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
hibernate-core/src/main/java/org/hibernate/cfg Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 155
155
import org .hibernate .id .TableHiLoGenerator ;
156
156
import org .hibernate .id .enhanced .SequenceStyleGenerator ;
157
157
import org .hibernate .internal .CoreMessageLogger ;
158
+ import org .hibernate .internal .util .StringHelper ;
158
159
import org .hibernate .mapping .Any ;
159
160
import org .hibernate .mapping .Component ;
160
161
import org .hibernate .mapping .DependantValue ;
@@ -2095,12 +2096,12 @@ else if ( !isId || !entityBinder.isIgnoreIdAnnotations() ) {
2095
2096
if ( naturalIdAnn != null ) {
2096
2097
if ( joinColumns != null ) {
2097
2098
for ( Ejb3Column column : joinColumns ) {
2098
- column .addUniqueKey ( "_UniqueKey" , inSecondPass );
2099
+ column .addUniqueKey ( StringHelper . randomFixedLengthHex ( "UK_" ) , inSecondPass );
2099
2100
}
2100
2101
}
2101
2102
else {
2102
2103
for ( Ejb3Column column : columns ) {
2103
- column .addUniqueKey ( "_UniqueKey" , inSecondPass );
2104
+ column .addUniqueKey ( StringHelper . randomFixedLengthHex ( "UK_" ) , inSecondPass );
2104
2105
}
2105
2106
}
2106
2107
}
Original file line number Diff line number Diff line change @@ -2248,7 +2248,7 @@ else if ( "filter".equals( name ) ) {
2248
2248
}
2249
2249
else if ( "natural-id" .equals ( name ) ) {
2250
2250
UniqueKey uk = new UniqueKey ();
2251
- uk .setName ("_UniqueKey" );
2251
+ uk .setName (StringHelper . randomFixedLengthHex ( "UK_" ) );
2252
2252
uk .setTable (table );
2253
2253
//by default, natural-ids are "immutable" (constant)
2254
2254
boolean mutableId = "true" .equals ( subnode .attributeValue ("mutable" ) );
You can’t perform that action at this time.
0 commit comments