org.apache.metamodel.jdbc.dialects
Interface IQueryRewriter

All Known Implementing Classes:
AbstractQueryRewriter, DB2QueryRewriter, DefaultQueryRewriter, H2QueryRewriter, HsqldbQueryRewriter, LimitOffsetQueryRewriter, MysqlQueryRewriter, PostgresqlQueryRewriter, SQLServerQueryRewriter

public interface IQueryRewriter

A query rewriter can be used for rewriting (part of) a query's string representation. This is usefull for databases that deviate from the SQL 99 compliant syntax which is delievered by the query and it's query item's toString() methods.

See Also:
AbstractQueryRewriter, JdbcDataContext

Method Summary
 String escapeQuotes(String item)
          Escapes the quotes within a String literal of a query item.
 ColumnType getColumnType(int jdbcType, String nativeType, Integer columnSize)
          Gets the column type for a specific JDBC type (as defined in Types), native type name and column size.
 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.
 String rewriteColumnType(ColumnType columnType)
          Rewrites the name of a column type, as it is written in CREATE TABLE statements.
 String rewriteFilterItem(FilterItem whereItem)
           
 String rewriteFromItem(FromItem item)
           
 String rewriteQuery(Query query)
           
 

Method Detail

rewriteFromItem

String rewriteFromItem(FromItem item)

rewriteQuery

String rewriteQuery(Query query)

rewriteFilterItem

String rewriteFilterItem(FilterItem whereItem)

isMaxRowsSupported

boolean isMaxRowsSupported()
Gets whether this query rewriter is able to write the "Max rows" query property to the query string.

Returns:
whether this query rewriter is able to write the "Max rows" query property to the query string.

isFirstRowSupported

boolean isFirstRowSupported()
Gets whether this query rewriter is able to write the "First row" query property to the query string.

Returns:
whether this query rewriter is able to write the "First row" query property to the query string.

escapeQuotes

String escapeQuotes(String item)
Escapes the quotes within a String literal of a query item.

Returns:
String item with quotes escaped.

rewriteColumnType

String rewriteColumnType(ColumnType columnType)
Rewrites the name of a column type, as it is written in CREATE TABLE statements. Some databases dont support all column types, or have different names for them. The implementation of this method will do that conversion.

Parameters:
columnType -
Returns:

getColumnType

ColumnType getColumnType(int jdbcType,
                         String nativeType,
                         Integer columnSize)
Gets the column type for a specific JDBC type (as defined in Types), native type name and column size.

Parameters:
jdbcType -
nativeType -
columnSize -
Returns:


Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.