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 |
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, toTimestamp
public DefaultQueryRewriter(JdbcDataContext dataContext)
protected Query beforeRewrite(Query query)
AbstractQueryRewriter
beforeRewrite
in class AbstractQueryRewriter
public String rewriteColumnType(ColumnType columnType, Integer columnSize)
IQueryRewriter
rewriteColumnType
in interface IQueryRewriter
rewriteColumnType
in class AbstractQueryRewriter
columnType
- 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 IQueryRewriter
rewriteFilterItem
in class AbstractQueryRewriter
protected 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)
IQueryRewriter
public boolean isAggregateFunctionSupported(AggregateFunction function)
IQueryRewriter
public boolean isFirstRowSupported(Query query)
IQueryRewriter
query
- For some database engines, the content of the query decides
the ability to change first rowpublic boolean isMaxRowsSupported()
IQueryRewriter
public String escapeQuotes(String item)
IQueryRewriter
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.