@@ -81,24 +81,21 @@ protected String substituteBrackets(String sqlQuery) throws QueryException {
81
81
final char ch = sqlQuery .charAt ( index );
82
82
switch (ch ) {
83
83
case '\'' :
84
- if (!doubleQuoted && !escaped ) {
85
- singleQuoted = !singleQuoted ;
86
- }
87
84
if (escaped ) {
88
85
token .append (ch );
89
- } else {
86
+ }
87
+ else {
88
+ if (!doubleQuoted ) {
89
+ singleQuoted = !singleQuoted ;
90
+ }
90
91
result .append (ch );
91
92
}
92
93
break ;
93
94
case '"' :
94
95
if (!singleQuoted && !escaped ) {
95
96
doubleQuoted = !doubleQuoted ;
96
97
}
97
- if (escaped ) {
98
- token .append (ch );
99
- } else {
100
- result .append (ch );
101
- }
98
+ result .append (ch );
102
99
break ;
103
100
case '{' :
104
101
if (!singleQuoted && !doubleQuoted ) {
@@ -224,7 +221,7 @@ private String resolveCollectionProperties(
224
221
}
225
222
aliasesFound ++;
226
223
return collectionPersister .selectFragment ( aliasName , collectionSuffix )
227
- + ", " + resolveProperties ( aliasName , propertyName );
224
+ + ", " + resolveProperties ( aliasName , propertyName );
228
225
case "element.*" :
229
226
return resolveProperties ( aliasName , "*" );
230
227
default :
@@ -274,7 +271,7 @@ private void validate(String aliasName, String propertyName, String[] columnAlia
274
271
// TODO: better error message since we actually support composites if names are explicitly listed
275
272
throw new QueryException (
276
273
"SQL queries only support properties mapped to a single column - property [" +
277
- propertyName + "] is mapped to " + columnAliases .length + " columns." ,
274
+ propertyName + "] is mapped to " + columnAliases .length + " columns." ,
278
275
originalQueryString
279
276
);
280
277
}
0 commit comments