File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -127,17 +127,18 @@ public string GetAlias(Dialect.Dialect dialect)
127
127
128
128
private string GetAlias ( int maxAliasLength )
129
129
{
130
- string alias = _name ;
130
+ var name = CanonicalName ;
131
+ string alias = name ;
131
132
string suffix = UniqueInteger . ToString ( ) + StringHelper . Underscore ;
132
133
133
- int lastLetter = StringHelper . LastIndexOfLetter ( _name ) ;
134
+ int lastLetter = StringHelper . LastIndexOfLetter ( name ) ;
134
135
if ( lastLetter == - 1 )
135
136
{
136
137
alias = "column" ;
137
138
}
138
- else if ( lastLetter < _name . Length - 1 )
139
+ else if ( lastLetter < name . Length - 1 )
139
140
{
140
- alias = _name . Substring ( 0 , lastLetter + 1 ) ;
141
+ alias = name . Substring ( 0 , lastLetter + 1 ) ;
141
142
}
142
143
143
144
// Updated logic ported from Hibernate's fix for HHH-8073.
@@ -147,9 +148,9 @@ private string GetAlias(int maxAliasLength)
147
148
// reason, the checks for "_quoted" and "rowid" looks redundant. If you remove
148
149
// those checks, then the double checks for total length can be reduced to one.
149
150
// But I will leave it like this for now to make it look similar. /Oskar 2016-08-20
150
- bool useRawName = _name . Length + suffix . Length <= maxAliasLength &&
151
+ bool useRawName = name . Length + suffix . Length <= maxAliasLength &&
151
152
! _quoted &&
152
- ! StringHelper . EqualsCaseInsensitive ( _name , "rowid" ) ;
153
+ ! StringHelper . EqualsCaseInsensitive ( name , "rowid" ) ;
153
154
if ( ! useRawName )
154
155
{
155
156
if ( suffix . Length >= maxAliasLength )
You can’t perform that action at this time.
0 commit comments