com.ibm.websphere.query.base
Interface ISelectQueryCallback

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CloudscapeSqlSelectQueryCallback, DB2390SqlSelectQueryCallback, DB2400SqlSelectQueryCallback, DB2SqlSelectQueryCallback, LdapSelectQueryCallback, OracleSqlSelectQueryCallback, com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter, SqlSelectQueryCallback

public interface ISelectQueryCallback
extends java.io.Serializable

The ISelectQueryCallback interface is intended to facilitate query string generation based on the domain specific requirements.

A class implements this interface to indicate that the instances of that class can produce a predicate string, an order by string, and other sub strings by introspecting the query objects in the framework. The query domain expert should resolve attribute mapping and syntax conversion in such a callback class so the meaningful query strings can be generically generated. That means the business developers for a domain can easily use the query framework without the knowledge of framework architecture or query callback implementation.


Field Summary
static java.lang.String JOIN_CONDITIONS
           
static java.lang.String JOIN_TABLES
           
static java.lang.String JOINS
           
static java.lang.String LAST_TABLE_ALIAS_INTEGER
           
static java.lang.String MULTIVALUE_PROPERTY_NAMES
           
static java.lang.String NAME_MAPPING
           
static java.lang.String PREDICATE_IS_NULL
           
static java.lang.String SELECT_ATTRIBUTES
           
static java.lang.String TABLE_MAP
           
static java.lang.String TABLE_NAME
           
static java.lang.String TYPE_MAPPING
           
 
Method Summary
 java.lang.String buildArithmeticCondition(IArithmeticCondition arithmeticCondition)
          Returns the string representation for the given operator.
 void buildArithmeticCondition(IArithmeticCondition arithmeticCondition, java.lang.StringBuffer sb)
           
 java.lang.String buildAttribute(IAttribute attribute)
          Returns the string representation for the given attribute.
 void buildAttribute(IAttribute attribute, java.lang.StringBuffer sb)
           
 java.lang.String buildCondition(ICondition condition)
          Returns the string representation for the given condition.
 void buildCondition(ICondition condition, java.lang.StringBuffer sb)
           
 void buildFrom(IFrom from, java.lang.StringBuffer sb)
          Returns the string representation for the given from.
 void buildFrom(ISelectQuery selectQuery, java.lang.StringBuffer sb)
          Returns the string representation for the given from.
 java.lang.String buildFunction(IFunction function)
          Returns the string representation for the given function.
 void buildFunction(IFunction function, java.lang.StringBuffer sb)
           
 void buildJoin(IJoin join, java.lang.StringBuffer sb)
          Returns the string representation for the given join.
 java.lang.String buildLimit(ILimit limit)
          Returns the string representation for the given limit clause.
 void buildLimit(ILimit limit, java.lang.StringBuffer sb)
           
 java.lang.String buildLimit(ISelectQuery selectQuery)
          Returns the string representation for the limit part of the given select query.
 void buildLimit(ISelectQuery selectQuery, java.lang.StringBuffer sb)
           
 java.lang.String buildOperator(IOperator operator)
          Returns the string representation for the given operator.
 void buildOperator(IOperator operator, java.lang.StringBuffer sb)
           
 java.lang.String buildOrderBy(IOrderBy orderBy)
          Returns the string representation for the given order by clause.
 void buildOrderBy(IOrderBy orderBy, java.lang.StringBuffer sb)
           
 java.lang.String buildOrderBy(ISelectQuery selectQuery)
          Returns the string representation for the order by part of the given select query.
 void buildOrderBy(ISelectQuery selectQuery, java.lang.StringBuffer sb)
           
 java.lang.String buildOrderByExpression(IOrderByExpression orderByExpression)
          Returns the string representation for the given order by expression.
 void buildOrderByExpression(IOrderByExpression orderByExpression, java.lang.StringBuffer sb)
           
 java.lang.String buildPredicate(IPredicate predicate)
          Returns the string representation for the given predicate.
 void buildPredicate(IPredicate predicate, java.lang.StringBuffer sb)
           
 java.lang.String buildPredicate(IQuery query)
          Returns the string representation for the predicate part of the given query.
 void buildPredicate(IQuery query, java.lang.StringBuffer sb)
           
 java.lang.String buildQuery(IQuery query)
          Returns the string representation for the given query.
 void buildSelect(ISelect select, java.lang.StringBuffer sb)
          Returns the string representation for the given select.
 java.lang.String buildSelectQuery(ISelectQuery selectQuery)
          Returns the string representation for the given select query.
 void buildSelectQuery(ISelectQuery selectQuery, java.lang.StringBuffer sb)
           
 void buildTable(ITable table, java.lang.StringBuffer sb)
          Returns the string representation for the given table.
 java.lang.String buildValue(IValue value)
          Returns the string representation for the given value.
 void buildValue(IValue value, java.lang.StringBuffer sb)
           
 

Field Detail

MULTIVALUE_PROPERTY_NAMES

static final java.lang.String MULTIVALUE_PROPERTY_NAMES
See Also:
Constant Field Values

TABLE_NAME

static final java.lang.String TABLE_NAME
See Also:
Constant Field Values

SELECT_ATTRIBUTES

static final java.lang.String SELECT_ATTRIBUTES
See Also:
Constant Field Values

TABLE_MAP

static final java.lang.String TABLE_MAP
See Also:
Constant Field Values

LAST_TABLE_ALIAS_INTEGER

static final java.lang.String LAST_TABLE_ALIAS_INTEGER
See Also:
Constant Field Values

PREDICATE_IS_NULL

static final java.lang.String PREDICATE_IS_NULL
See Also:
Constant Field Values

JOIN_CONDITIONS

static final java.lang.String JOIN_CONDITIONS
See Also:
Constant Field Values

JOIN_TABLES

static final java.lang.String JOIN_TABLES
See Also:
Constant Field Values

JOINS

static final java.lang.String JOINS
See Also:
Constant Field Values

NAME_MAPPING

static final java.lang.String NAME_MAPPING
See Also:
Constant Field Values

TYPE_MAPPING

static final java.lang.String TYPE_MAPPING
See Also:
Constant Field Values
Method Detail

buildAttribute

java.lang.String buildAttribute(IAttribute attribute)
                                throws QueryException
Returns the string representation for the given attribute. Domain specific attribute mapping can be used here to generate meaningful strings.

Throws:
QueryException

buildAttribute

void buildAttribute(IAttribute attribute,
                    java.lang.StringBuffer sb)
                    throws QueryException
Throws:
QueryException

buildCondition

java.lang.String buildCondition(ICondition condition)
                                throws QueryException

Returns the string representation for the given condition. Domain specific condition syntax can be applied here to generate meaningful strings.

This method should define string generation for all possible operators in terms of text for operators and notatation for attributes (infix, postfix or prefix). A sample code in the builder callback could look like:

if (operator is GT) ...

elseif (operator is BTW) ...

elseif (operator is MVALL) ...

elseif ......

Throws:
QueryException

buildCondition

void buildCondition(ICondition condition,
                    java.lang.StringBuffer sb)
                    throws QueryException
Throws:
QueryException

buildFunction

java.lang.String buildFunction(IFunction function)
                               throws QueryException
Returns the string representation for the given function. Domain specific function syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildFunction

void buildFunction(IFunction function,
                   java.lang.StringBuffer sb)
                   throws QueryException
Throws:
QueryException

buildArithmeticCondition

java.lang.String buildArithmeticCondition(IArithmeticCondition arithmeticCondition)
                                          throws QueryException
Returns the string representation for the given operator. Domain specific operator syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildArithmeticCondition

void buildArithmeticCondition(IArithmeticCondition arithmeticCondition,
                              java.lang.StringBuffer sb)
                              throws QueryException
Throws:
QueryException

buildOperator

java.lang.String buildOperator(IOperator operator)
                               throws QueryException
Returns the string representation for the given operator. Domain specific operator syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildOperator

void buildOperator(IOperator operator,
                   java.lang.StringBuffer sb)
                   throws QueryException
Throws:
QueryException

buildOrderBy

java.lang.String buildOrderBy(IOrderBy orderBy)
                              throws QueryException
Returns the string representation for the given order by clause. Domain specific order by syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildOrderBy

void buildOrderBy(IOrderBy orderBy,
                  java.lang.StringBuffer sb)
                  throws QueryException
Throws:
QueryException

buildOrderBy

java.lang.String buildOrderBy(ISelectQuery selectQuery)
                              throws QueryException
Returns the string representation for the order by part of the given select query. Domain specific order by syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildOrderBy

void buildOrderBy(ISelectQuery selectQuery,
                  java.lang.StringBuffer sb)
                  throws QueryException
Throws:
QueryException

buildOrderByExpression

java.lang.String buildOrderByExpression(IOrderByExpression orderByExpression)
                                        throws QueryException
Returns the string representation for the given order by expression. Domain specific order by expression syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildOrderByExpression

void buildOrderByExpression(IOrderByExpression orderByExpression,
                            java.lang.StringBuffer sb)
                            throws QueryException
Throws:
QueryException

buildLimit

java.lang.String buildLimit(ILimit limit)
                            throws QueryException
Returns the string representation for the given limit clause. Domain specific limit syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildLimit

void buildLimit(ILimit limit,
                java.lang.StringBuffer sb)
                throws QueryException
Throws:
QueryException

buildLimit

java.lang.String buildLimit(ISelectQuery selectQuery)
                            throws QueryException
Returns the string representation for the limit part of the given select query. Domain specific limit syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildLimit

void buildLimit(ISelectQuery selectQuery,
                java.lang.StringBuffer sb)
                throws QueryException
Throws:
QueryException

buildPredicate

java.lang.String buildPredicate(IPredicate predicate)
                                throws QueryException
Returns the string representation for the given predicate. Domain specific predicate syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildPredicate

void buildPredicate(IPredicate predicate,
                    java.lang.StringBuffer sb)
                    throws QueryException
Throws:
QueryException

buildPredicate

java.lang.String buildPredicate(IQuery query)
                                throws QueryException
Returns the string representation for the predicate part of the given query. Domain specific predicate syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildPredicate

void buildPredicate(IQuery query,
                    java.lang.StringBuffer sb)
                    throws QueryException
Throws:
QueryException

buildQuery

java.lang.String buildQuery(IQuery query)
                            throws QueryException
Returns the string representation for the given query. Domain specific query syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildSelectQuery

java.lang.String buildSelectQuery(ISelectQuery selectQuery)
                                  throws QueryException
Returns the string representation for the given select query. Domain specific query syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildSelectQuery

void buildSelectQuery(ISelectQuery selectQuery,
                      java.lang.StringBuffer sb)
                      throws QueryException
Throws:
QueryException

buildValue

java.lang.String buildValue(IValue value)
                            throws QueryException
Returns the string representation for the given value. Domain specific value syntax can be applied here to generate meaningful strings.

Throws:
QueryException

buildValue

void buildValue(IValue value,
                java.lang.StringBuffer sb)
                throws QueryException
Throws:
QueryException

buildTable

void buildTable(ITable table,
                java.lang.StringBuffer sb)
                throws QueryException
Returns the string representation for the given table.

Throws:
QueryException

buildSelect

void buildSelect(ISelect select,
                 java.lang.StringBuffer sb)
                 throws QueryException
Returns the string representation for the given select.

Throws:
QueryException

buildFrom

void buildFrom(IFrom from,
               java.lang.StringBuffer sb)
               throws QueryException
Returns the string representation for the given from.

Throws:
QueryException

buildFrom

void buildFrom(ISelectQuery selectQuery,
               java.lang.StringBuffer sb)
               throws QueryException
Returns the string representation for the given from.

Throws:
QueryException

buildJoin

void buildJoin(IJoin join,
               java.lang.StringBuffer sb)
               throws QueryException
Returns the string representation for the given join.

Throws:
QueryException