|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.storage.search.implementation.database.ChainedSqlHandler
Baseclass for chained sql handlers, these are
SqlHandler
implementations that wrap SqlHandler objects to create a chain
of handlers, following the Chain Of Responsibility design pattern.
This class is provided as a baseclass to for chained handlers.
It implements all SqlHandler methods by delegating to
its successor, i.e. the next handler in the chain.
SqlHandler| Constructor Summary | |
ChainedSqlHandler(SqlHandler successor)
Creates a new instance of ChainedSqlHandler. |
|
| Method Summary | |
void |
appendConstraintToSql(java.lang.StringBuffer sb,
Constraint constraint,
SearchQuery query,
boolean inverse,
boolean inComposite)
Represents Constraint object, that is not a CompositeConstraint, as a constraint in SQL format, appending the result to a stringbuffer. |
void |
appendQueryBodyToSql(java.lang.StringBuffer sb,
SearchQuery query,
SqlHandler firstInChain)
Represents body of a SearchQuery object as a string in SQL format, using the database configuration. |
java.lang.String |
getAllowedValue(java.lang.String value)
Maps string to value that is allowed as table or field name. |
protected SqlHandler |
getSuccessor()
Accessor to successor in chain of responsibility. |
int |
getSupportLevel(Constraint constraint,
SearchQuery query)
Gets the level at which a constraint is supported for a query by this handler. |
int |
getSupportLevel(int feature,
SearchQuery query)
Gets the level at which a feature is supported for a query by this handler. |
java.lang.String |
toSql(SearchQuery query,
SqlHandler firstInChain)
Represents a SearchQuery object as a string in SQL format, using the database configuration. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ChainedSqlHandler(SqlHandler successor)
successor - Successor in chain of responsibility.| Method Detail |
public java.lang.String toSql(SearchQuery query,
SqlHandler firstInChain)
throws SearchQueryException
SqlHandler
toSql in interface SqlHandlerquery - The searchquery.firstInChain - The first element in the chain of handlers.
At some point appendQueryBodyToSql() will have
to be called on this handler, to generate the body of the query.
- Returns:
- SQL string representation of the query.
- Throws:
SearchQueryException
public void appendQueryBodyToSql(java.lang.StringBuffer sb,
SearchQuery query,
SqlHandler firstInChain)
throws SearchQueryException
SqlHandler
appendQueryBodyToSql in interface SqlHandlersb - The stringbuffer to append to.query - The searchquery.firstInChain - The first element in the chain of handlers.
At some point appendConstraintToSql() will have
to be called on this handler, to generate the constraints in
the query.
SearchQueryException
public void appendConstraintToSql(java.lang.StringBuffer sb,
Constraint constraint,
SearchQuery query,
boolean inverse,
boolean inComposite)
throws SearchQueryException
SqlHandler
appendConstraintToSql in interface SqlHandlersb - The stringbuffer to append to.constraint - The (non-composite) constraint.query - The searchquery containing the constraint.inverse - True when the inverse constraint must be represented,
false otherwise.inComposite - True when the constraint is part of
a composite expression.
SearchQueryException
public int getSupportLevel(int feature,
SearchQuery query)
throws SearchQueryException
SqlHandler
getSupportLevel in interface SqlHandlerSearchQueryException
public int getSupportLevel(Constraint constraint,
SearchQuery query)
throws SearchQueryException
SqlHandler
getSupportLevel in interface SqlHandlerSearchQueryExceptionpublic java.lang.String getAllowedValue(java.lang.String value)
SqlHandler
getAllowedValue in interface SqlHandlerprotected SqlHandler getSuccessor()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||