|
20 | 20 | import org.hibernate.sql.ast.tree.expression.Expression; |
21 | 21 | import org.hibernate.sql.ast.tree.expression.FunctionExpression; |
22 | 22 | import org.hibernate.sql.ast.tree.expression.Literal; |
23 | | -import org.hibernate.sql.ast.tree.expression.SelfRenderingExpression; |
24 | 23 | import org.hibernate.sql.ast.tree.expression.SqlTuple; |
25 | 24 | import org.hibernate.sql.ast.tree.expression.Summarization; |
26 | 25 | import org.hibernate.sql.ast.tree.from.NamedTableReference; |
@@ -191,18 +190,6 @@ else if ( expression instanceof Summarization ) { |
191 | 190 | } |
192 | 191 | } |
193 | 192 |
|
194 | | -// @Override |
195 | | -// protected void renderNull(Literal literal) { |
196 | | -// if ( getParameterRenderingMode() == SqlAstNodeRenderingMode.NO_UNTYPED ) { |
197 | | -// renderCasted( literal ); |
198 | | -// } |
199 | | -// else { |
200 | | -// int sqlType = literal.getExpressionType().getSingleJdbcMapping().getJdbcType().getJdbcTypeCode(); |
201 | | -// String nullString = getDialect().getSelectClauseNullString( sqlType, getSessionFactory().getTypeConfiguration() ); |
202 | | -// appendSql( nullString ); |
203 | | -// } |
204 | | -// } |
205 | | - |
206 | 193 | @Override |
207 | 194 | protected void renderInsertIntoNoColumns(TableInsertStandard tableInsert) { |
208 | 195 | renderIntoIntoAndTable( tableInsert ); |
@@ -245,7 +232,7 @@ public void visitValuesTableReference(ValuesTableReference tableReference) { |
245 | 232 | protected boolean shouldEmulateFetchClause(QueryPart queryPart) { |
246 | 233 | // Check if current query part is already row numbering to avoid infinite recursion |
247 | 234 | return useOffsetFetchClause( queryPart ) && getQueryPartForRowNumbering() != queryPart |
248 | | - && getDialect().supportsWindowFunctions() && !isRowsOnlyFetchClauseType( queryPart ); |
| 235 | + && getDialect().supportsWindowFunctions() && !isRowsOnlyFetchClauseType( queryPart ); |
249 | 236 | } |
250 | 237 |
|
251 | 238 | @Override |
@@ -295,26 +282,6 @@ protected void visitArithmeticOperand(Expression expression) { |
295 | 282 | } |
296 | 283 | } |
297 | 284 |
|
298 | | - private static boolean isStringFunctionWithParameterArg(SelfRenderingExpression expression) { |
299 | | - return expression instanceof FunctionExpression fn |
300 | | - && expression.getExpressionType() != null |
301 | | - && expression.getExpressionType().getJdbcTypeCount() == 1 |
302 | | - && expression.getExpressionType().getSingleJdbcMapping().getJdbcType().isString() |
303 | | - && fn.getArguments().stream().anyMatch( arg -> arg instanceof SqmParameterInterpretation ); |
304 | | - } |
305 | | - |
306 | | - @Override |
307 | | - public void visitSelfRenderingExpression(SelfRenderingExpression expression) { |
308 | | - if ( isStringFunctionWithParameterArg( expression ) ) { |
309 | | - append( "cast(" ); |
310 | | - super.visitSelfRenderingExpression( expression ); |
311 | | - append( " as lvarchar)" ); |
312 | | - } |
313 | | - else { |
314 | | - super.visitSelfRenderingExpression( expression ); |
315 | | - } |
316 | | - } |
317 | | - |
318 | 285 | private static boolean isConcatFunction(Expression expression) { |
319 | 286 | return expression instanceof FunctionExpression fn |
320 | 287 | && fn.getFunctionName().equals( "concat" ); |
|
0 commit comments