Skip to content

Commit ab0bdf9

Browse files
Stefan-Tribeikov
authored andcommitted
HHH-19558: Removed double quoted case
1 parent e5b16a0 commit ab0bdf9

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

hibernate-core/src/main/java/org/hibernate/query/sql/internal/SQLQueryParser.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,21 @@ protected String substituteBrackets(String sqlQuery) throws QueryException {
8181
final char ch = sqlQuery.charAt( index );
8282
switch (ch) {
8383
case '\'':
84-
if (!doubleQuoted && !escaped) {
85-
singleQuoted = !singleQuoted;
86-
}
8784
if (escaped) {
8885
token.append(ch);
89-
} else {
86+
}
87+
else {
88+
if (!doubleQuoted) {
89+
singleQuoted = !singleQuoted;
90+
}
9091
result.append(ch);
9192
}
9293
break;
9394
case '"':
9495
if (!singleQuoted && !escaped) {
9596
doubleQuoted = !doubleQuoted;
9697
}
97-
if (escaped) {
98-
token.append(ch);
99-
} else {
100-
result.append(ch);
101-
}
98+
result.append(ch);
10299
break;
103100
case '{':
104101
if (!singleQuoted && !doubleQuoted) {
@@ -224,7 +221,7 @@ private String resolveCollectionProperties(
224221
}
225222
aliasesFound++;
226223
return collectionPersister.selectFragment( aliasName, collectionSuffix )
227-
+ ", " + resolveProperties( aliasName, propertyName );
224+
+ ", " + resolveProperties( aliasName, propertyName );
228225
case "element.*":
229226
return resolveProperties( aliasName, "*" );
230227
default:
@@ -274,7 +271,7 @@ private void validate(String aliasName, String propertyName, String[] columnAlia
274271
// TODO: better error message since we actually support composites if names are explicitly listed
275272
throw new QueryException(
276273
"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.",
278275
originalQueryString
279276
);
280277
}

0 commit comments

Comments
 (0)