public class DefaultQueryRewriter extends AbstractQueryRewriter
| 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(Query query)
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 |
isPrimaryKeySupported()
Determines if the JDBC data source supports primary keys or not.
|
boolean |
isScalarFunctionSupported(ScalarFunction function)
Determines whether a specific scalar function is supported by the
database or not.
|
protected boolean |
needsQuoting(String alias,
String identifierQuoteString) |
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, getResultSetValue, isSchemaIncludedInColumnPaths, isSupportedVersion, isTransactional, rewriteColumnTypeInternal, rewriteFromClause, rewriteFromItem, rewriteFromItem, rewriteGroupByClause, rewriteGroupByItem, rewriteHavingClause, rewriteOrderByClause, rewriteOrderByItem, rewriteQuery, rewriteSelectClause, rewriteSelectItem, rewriteWhereClause, setStatementParameter, toTime, toTimestamppublic 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(Query query)
IQueryRewriterquery - For some database engines, the content of the query decides
the ability to change first rowpublic boolean isMaxRowsSupported()
IQueryRewriterpublic String escapeQuotes(String item)
IQueryRewriterpublic boolean isPrimaryKeySupported()
IQueryRewriterCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.