public class DefaultQueryRewriter extends AbstractQueryRewriter
logger| Constructor and Description |
|---|
DefaultQueryRewriter(JdbcDataContext dataContext) |
| Modifier and Type | Method and Description |
|---|---|
protected Query |
beforeRewrite(Query query)
Method to modify query before rewriting begins.
|
String |
escapeQuotes(String item)
Escapes the quotes within a String literal of a query item.
|
boolean |
isAggregateFunctionSupported(AggregateFunction function)
Determines whether a specific aggregate function is supported by the
database or not.
|
boolean |
isFirstRowSupported()
Gets whether this query rewriter is able to write the "First row" query
property to the query string.
|
boolean |
isMaxRowsSupported()
Gets whether this query rewriter is able to write the "Max rows" query
property to the query string.
|
boolean |
isScalarFunctionSupported(ScalarFunction function)
Determines whether a specific scalar function is supported by the
database or not.
|
String |
rewriteColumnType(ColumnType columnType,
Integer columnSize)
Rewrites the name of a column type, as it is written in CREATE TABLE
statements.
|
String |
rewriteFilterItem(FilterItem item) |
protected String |
rewriteFilterItemWithOperandLiteral(FilterItem item,
String operandLiteral)
Rewrites a (non-compound)
FilterItem when it's operand has
already been rewritten into a SQL literal. |
protected String |
rewriteTimestamp(Timestamp ts)
Rewrites a
Timestamp into it's literal representation as known by
this SQL dialect. |
getColumnType, getDataContext, isSchemaIncludedInColumnPaths, isTransactional, rewriteColumnTypeInternal, rewriteFromClause, rewriteFromItem, rewriteFromItem, rewriteGroupByClause, rewriteGroupByItem, rewriteHavingClause, rewriteOrderByClause, rewriteOrderByItem, rewriteQuery, rewriteSelectClause, rewriteSelectItem, rewriteWhereClausepublic DefaultQueryRewriter(JdbcDataContext dataContext)
protected Query beforeRewrite(Query query)
AbstractQueryRewriterbeforeRewrite in class AbstractQueryRewriterpublic String rewriteColumnType(ColumnType columnType, Integer columnSize)
IQueryRewriterrewriteColumnType in interface IQueryRewriterrewriteColumnType in class AbstractQueryRewritercolumnType - the (non-null) ColumnType to rewritecolumnSize - the (possibly null) column size that may or may not have been
specifiedpublic String rewriteFilterItem(FilterItem item)
rewriteFilterItem in interface IQueryRewriterrewriteFilterItem in class AbstractQueryRewriterprotected String rewriteFilterItemWithOperandLiteral(FilterItem item, String operandLiteral)
FilterItem when it's operand has
already been rewritten into a SQL literal.item - operandLiteral - protected String rewriteTimestamp(Timestamp ts)
Timestamp into it's literal representation as known by
this SQL dialect.
This default implementation returns the JDBC spec's escape syntax for a
timestamp: {ts 'yyyy-mm-dd hh:mm:ss.f . . .'}ts - public boolean isScalarFunctionSupported(ScalarFunction function)
IQueryRewriterpublic boolean isAggregateFunctionSupported(AggregateFunction function)
IQueryRewriterpublic boolean isFirstRowSupported()
IQueryRewriterpublic boolean isMaxRowsSupported()
IQueryRewriterpublic String escapeQuotes(String item)
IQueryRewriterCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.