@@ -86,24 +86,21 @@ protected String substituteBrackets(String sqlQuery) throws QueryException {
8686			final  char  ch  = sqlQuery .charAt ( index  );
8787			switch  (ch ) {
8888				case  '\'' :
89- 					if  (!doubleQuoted  && !escaped ) {
90- 						singleQuoted  = !singleQuoted ;
91- 					}
9289					if  (escaped ) {
9390						token .append (ch );
94- 					} else  {
91+ 					}
92+ 					else  {
93+ 						if  (!doubleQuoted ) {
94+ 							singleQuoted  = !singleQuoted ;
95+ 						}
9596						result .append (ch );
9697					}
9798					break ;
9899				case  '"' :
99100					if  (!singleQuoted  && !escaped ) {
100101						doubleQuoted  = !doubleQuoted ;
101102					}
102- 					if  (escaped ) {
103- 						token .append (ch );
104- 					} else  {
105- 						result .append (ch );
106- 					}
103+ 					result .append (ch );
107104					break ;
108105				case  '{' :
109106					if  (!singleQuoted  && !doubleQuoted ) {
@@ -228,7 +225,7 @@ private String resolveCollectionProperties(
228225				}
229226				aliasesFound ++;
230227				return  collectionPersister .selectFragment ( aliasName , collectionSuffix  )
231- 						 + ", "  + resolveProperties ( aliasName , propertyName  );
228+ 					+ ", "  + resolveProperties ( aliasName , propertyName  );
232229			case  "element.*" :
233230				return  resolveProperties ( aliasName , "*"  );
234231			default :
@@ -278,7 +275,7 @@ private void validate(String aliasName, String propertyName, String[] columnAlia
278275			// TODO: better error message since we actually support composites if names are explicitly listed 
279276			throw  new  QueryException (
280277					"SQL queries only support properties mapped to a single column - property ["  +
281- 							 propertyName  + "] is mapped to "  + columnAliases .length  + " columns." ,
278+ 					propertyName  + "] is mapped to "  + columnAliases .length  + " columns." ,
282279					originalQueryString 
283280			);
284281		}
0 commit comments