org.apache.metamodel.jdbc.dialects
Class DB2QueryRewriter

java.lang.Object
  extended by org.apache.metamodel.jdbc.dialects.AbstractQueryRewriter
      extended by org.apache.metamodel.jdbc.dialects.DefaultQueryRewriter
          extended by org.apache.metamodel.jdbc.dialects.DB2QueryRewriter
All Implemented Interfaces:
IQueryRewriter

public class DB2QueryRewriter
extends DefaultQueryRewriter
implements IQueryRewriter

Query rewriter for IBM DB2


Field Summary
 
Fields inherited from class org.apache.metamodel.jdbc.dialects.AbstractQueryRewriter
logger
 
Constructor Summary
DB2QueryRewriter(JdbcDataContext dataContext)
           
 
Method Summary
 String escapeQuotes(String filterItemOperand)
          Escapes the quotes within a String literal of a query item.
 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 isSchemaIncludedInColumnPaths()
          DB2 expects the fully qualified column name, including schema, in select items.
 String rewriteColumnType(ColumnType columnType)
          Rewrites the name of a column type, as it is written in CREATE TABLE statements.
 String rewriteFilterItem(FilterItem item)
           
 String rewriteQuery(Query query)
           
 
Methods inherited from class org.apache.metamodel.jdbc.dialects.DefaultQueryRewriter
beforeRewrite
 
Methods inherited from class org.apache.metamodel.jdbc.dialects.AbstractQueryRewriter
getColumnType, getDataContext, rewriteFromClause, rewriteFromItem, rewriteFromItem, rewriteGroupByClause, rewriteGroupByItem, rewriteHavingClause, rewriteOrderByClause, rewriteOrderByItem, rewriteSelectClause, rewriteSelectItem, rewriteWhereClause
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.metamodel.jdbc.dialects.IQueryRewriter
getColumnType, rewriteFromItem
 

Constructor Detail

DB2QueryRewriter

public DB2QueryRewriter(JdbcDataContext dataContext)
Method Detail

escapeQuotes

public String escapeQuotes(String filterItemOperand)
Description copied from interface: IQueryRewriter
Escapes the quotes within a String literal of a query item.

Specified by:
escapeQuotes in interface IQueryRewriter
Overrides:
escapeQuotes in class DefaultQueryRewriter
Returns:
String item with quotes escaped.

isSchemaIncludedInColumnPaths

public boolean isSchemaIncludedInColumnPaths()
DB2 expects the fully qualified column name, including schema, in select items.

Overrides:
isSchemaIncludedInColumnPaths in class AbstractQueryRewriter

isMaxRowsSupported

public boolean isMaxRowsSupported()
Description copied from interface: IQueryRewriter
Gets whether this query rewriter is able to write the "Max rows" query property to the query string.

Specified by:
isMaxRowsSupported in interface IQueryRewriter
Overrides:
isMaxRowsSupported in class DefaultQueryRewriter
Returns:
whether this query rewriter is able to write the "Max rows" query property to the query string.

isFirstRowSupported

public boolean isFirstRowSupported()
Description copied from interface: IQueryRewriter
Gets whether this query rewriter is able to write the "First row" query property to the query string.

Specified by:
isFirstRowSupported in interface IQueryRewriter
Overrides:
isFirstRowSupported in class DefaultQueryRewriter
Returns:
whether this query rewriter is able to write the "First row" query property to the query string.

rewriteQuery

public String rewriteQuery(Query query)
Specified by:
rewriteQuery in interface IQueryRewriter
Overrides:
rewriteQuery in class AbstractQueryRewriter

rewriteColumnType

public String rewriteColumnType(ColumnType columnType)
Description copied from interface: IQueryRewriter
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.

Specified by:
rewriteColumnType in interface IQueryRewriter
Overrides:
rewriteColumnType in class AbstractQueryRewriter
Returns:

rewriteFilterItem

public String rewriteFilterItem(FilterItem item)
Specified by:
rewriteFilterItem in interface IQueryRewriter
Overrides:
rewriteFilterItem in class DefaultQueryRewriter


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