|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter com.ibm.websphere.query.callbacks.LdapSelectQueryCallback
public class LdapSelectQueryCallback
The LdapSelectQueryCallback class is a query builder callback for LDAP. It provides attributes mapping and query syntax conversion for developers to build meaningful LDAP query strings.
It implements the ISelectQueryCallback interface so it can be used whenever an ISelectQueryCallback is needed.
This class has a hash table that contains SQL attributes mapping. When building an attribute string, the hash table is looked up to perform an attribute conversion.
Field Summary | |
---|---|
static java.lang.String |
LDAP_QUERY_AND
|
static java.lang.String |
LDAP_QUERY_CONDITIONHEAD
|
static java.lang.String |
LDAP_QUERY_CONDITIONTAIL
|
static java.lang.String |
LDAP_QUERY_EQ
|
static java.lang.String |
LDAP_QUERY_GEQ
|
static java.lang.String |
LDAP_QUERY_LEFTPAREN
|
static java.lang.String |
LDAP_QUERY_LEQ
|
static java.lang.String |
LDAP_QUERY_LIKE
|
static java.lang.String |
LDAP_QUERY_NOT
|
static java.lang.String |
LDAP_QUERY_OR
|
static java.lang.String |
LDAP_QUERY_ORDERBYASC
|
static java.lang.String |
LDAP_QUERY_ORDERBYDES
|
static java.lang.String |
LDAP_QUERY_PREDICATEHEAD
|
static java.lang.String |
LDAP_QUERY_PREDICATETAIL
|
static java.lang.String |
LDAP_QUERY_RIGHTPAREN
|
static java.lang.String |
LDAP_QUERY_WILDCARD
|
protected int |
nbSortStrings
|
protected java.lang.String[] |
sortStrings
|
protected java.util.Map |
typeMapping
|
Fields inherited from interface com.ibm.websphere.query.base.ISelectQueryCallback |
---|
JOIN_CONDITIONS, JOIN_TABLES, JOINS, LAST_TABLE_ALIAS_INTEGER, MULTIVALUE_PROPERTY_NAMES, NAME_MAPPING, PREDICATE_IS_NULL, SELECT_ATTRIBUTES, TABLE_MAP, TABLE_NAME, TYPE_MAPPING |
Constructor Summary | |
---|---|
LdapSelectQueryCallback()
Creates a new LdapSelectQueryCallback instance, default constructor. |
|
LdapSelectQueryCallback(java.util.Hashtable ht)
Creates a new LdapSelectQueryCallback instance with the given attribute mapping. |
|
LdapSelectQueryCallback(java.util.Map newNameMapping,
java.util.Map newTypeMapping)
Creates a new LdapSelectQueryCallback instance with the given attribute and type mappings. |
Method Summary | |
---|---|
java.lang.String |
buildArithmeticCondition(IArithmeticCondition arithmeticCondition)
Returns the string representation for the given operator. |
java.lang.String |
buildAttribute(IAttribute attribute)
Returns the LDAP attribute string for the given attribute. |
java.lang.String |
buildCondition(ICondition condition)
Returns the LDAP condition string for the given condition. |
java.lang.String |
buildFunction(IFunction function)
Throws an exception because LDAP does not support functions. |
java.lang.String |
buildLimit(ILimit limit)
Returns the string representation for the given limit clause. |
java.lang.String |
buildLimit(ISelectQuery selectQuery)
Returns the string representation for the limit part of the given select query. |
java.lang.String |
buildOperator(IOperator operator)
Returns the LDAP operator string for the given operator. |
java.lang.String |
buildOrderBy(IOrderBy orderBy)
This method iterates through the order by expressions in the order by object to generate the order by string in LDAP. |
java.lang.String |
buildOrderBy(ISelectQuery selectQuery)
This method uses the order by in the select query to generate the order by string in LDAP. |
java.lang.String |
buildOrderByExpression(IOrderByExpression orderByExpression)
This method uses the order by element and operator in the order by expression to generate the order by expression strings as an array of strings. |
java.lang.String |
buildPredicate(IPredicate predicate)
Returns the LDAP predicate string for the given predicate. |
java.lang.String |
buildPredicate(IQuery query)
Returns the LDAP predicate string for the given query. |
java.lang.String |
buildQuery(IQuery query)
Returns the LDAP query string for the given query. |
java.lang.String |
buildSelectQuery(ISelectQuery selectQuery)
Returns the LDAP select query string for the given select query. |
java.lang.String |
buildValue(IValue value)
Returns the LDAP value string for the given value. |
protected java.lang.String |
buildValueString(java.lang.String valueString)
Returns the LDAP query safe value string for the given string. |
long |
getLimit(ISelectQuery selectQuery)
|
java.util.Map |
getNameMapping()
Returns the attribute mapping hash table of the builder callback. |
java.lang.String[] |
getSortStrings()
Returns the sort strings of the builder callback. |
void |
setNameMapping(java.util.Hashtable newNameMapping)
Sets the attribute mapping hash table of the builder callback. |
Methods inherited from class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter |
---|
buildArithmeticCondition, buildAttribute, buildCondition, buildFrom, buildFrom, buildFunction, buildJoin, buildLimit, buildLimit, buildOperator, buildOrderBy, buildOrderBy, buildOrderByExpression, buildPredicate, buildPredicate, buildQuery, buildSelect, buildSelectQuery, buildTable, buildValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.websphere.query.base.ISelectQueryCallback |
---|
buildArithmeticCondition, buildAttribute, buildCondition, buildFrom, buildFrom, buildFunction, buildJoin, buildLimit, buildLimit, buildOperator, buildOrderBy, buildOrderBy, buildOrderByExpression, buildPredicate, buildPredicate, buildSelect, buildSelectQuery, buildTable, buildValue |
Field Detail |
---|
public static final java.lang.String LDAP_QUERY_LEFTPAREN
public static final java.lang.String LDAP_QUERY_NOT
public static final java.lang.String LDAP_QUERY_RIGHTPAREN
public static final java.lang.String LDAP_QUERY_PREDICATEHEAD
public static final java.lang.String LDAP_QUERY_PREDICATETAIL
public static final java.lang.String LDAP_QUERY_CONDITIONHEAD
public static final java.lang.String LDAP_QUERY_CONDITIONTAIL
public static final java.lang.String LDAP_QUERY_AND
public static final java.lang.String LDAP_QUERY_OR
public static final java.lang.String LDAP_QUERY_EQ
public static final java.lang.String LDAP_QUERY_LEQ
public static final java.lang.String LDAP_QUERY_GEQ
protected java.util.Map typeMapping
public static final java.lang.String LDAP_QUERY_LIKE
public static final java.lang.String LDAP_QUERY_ORDERBYASC
public static final java.lang.String LDAP_QUERY_ORDERBYDES
public static final java.lang.String LDAP_QUERY_WILDCARD
protected int nbSortStrings
protected java.lang.String[] sortStrings
Constructor Detail |
---|
public LdapSelectQueryCallback()
public LdapSelectQueryCallback(java.util.Hashtable ht)
public LdapSelectQueryCallback(java.util.Map newNameMapping, java.util.Map newTypeMapping)
Method Detail |
---|
public java.lang.String buildAttribute(IAttribute attribute) throws QueryException
Returns the LDAP attribute string for the given attribute.
buildAttribute
in interface ISelectQueryCallback
buildAttribute
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildCondition(ICondition condition) throws QueryException
Returns the LDAP condition string for the given condition.
This method defines string generation for conditions with all possible operators supported in LDAP.
buildCondition
in interface ISelectQueryCallback
buildCondition
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildFunction(IFunction function) throws QueryException
Throws an exception because LDAP does not support functions.
buildFunction
in interface ISelectQueryCallback
buildFunction
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildOperator(IOperator operator) throws QueryException
Returns the LDAP operator string for the given operator.
This method defines string generation for all possible operators supported in LDAP.
buildOperator
in interface ISelectQueryCallback
buildOperator
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildOrderBy(IOrderBy orderBy) throws QueryException
This method iterates through the order by expressions in the order by object to generate the order by string in LDAP.
buildOrderBy
in interface ISelectQueryCallback
buildOrderBy
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildOrderBy(ISelectQuery selectQuery) throws QueryException
This method uses the order by in the select query to generate the order by string in LDAP.
buildOrderBy
in interface ISelectQueryCallback
buildOrderBy
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildOrderByExpression(IOrderByExpression orderByExpression) throws QueryException
This method uses the order by element and operator in the order by expression to generate the order by expression strings as an array of strings. The results are stored as an instance variable so the builder callback users can use them to construct the final LDAP query string.
buildOrderByExpression
in interface ISelectQueryCallback
buildOrderByExpression
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildPredicate(IPredicate predicate) throws QueryException
Returns the LDAP predicate string for the given predicate.
This method uses the predicate bases in the predicate to generate the predicate string in LDAP.
buildPredicate
in interface ISelectQueryCallback
buildPredicate
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildPredicate(IQuery query) throws QueryException
Returns the LDAP predicate string for the given query.
This method uses the predicate in the query to generate the predicate string in LDAP.
buildPredicate
in interface ISelectQueryCallback
buildPredicate
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildQuery(IQuery query) throws QueryException
Returns the LDAP query string for the given query.
This method calls buildPredicate() to generate the query string in LDAP.
buildQuery
in interface ISelectQueryCallback
buildQuery
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildSelectQuery(ISelectQuery selectQuery) throws QueryException
Returns the LDAP select query string for the given select query.
This method calls buildPredicate() to generate the select query string in LDAP. It also calls buildOrderBy() to generate the string array for order by as an instance variable.
buildSelectQuery
in interface ISelectQueryCallback
buildSelectQuery
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.lang.String buildValue(IValue value) throws QueryException
Returns the LDAP value string for the given value.
This method generates the value string in LDAP based on the data type.
buildValue
in interface ISelectQueryCallback
buildValue
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
public java.util.Map getNameMapping()
public void setNameMapping(java.util.Hashtable newNameMapping)
protected java.lang.String buildValueString(java.lang.String valueString) throws QueryException
Returns the LDAP query safe value string for the given string.
QueryException
public java.lang.String[] getSortStrings()
public java.lang.String buildArithmeticCondition(IArithmeticCondition arithmeticCondition) throws QueryException
ISelectQueryCallback
buildArithmeticCondition
in interface ISelectQueryCallback
buildArithmeticCondition
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
ISelectQueryCallback#buildArithmeticCondition(IArithmeticCondition)
public long getLimit(ISelectQuery selectQuery) throws QueryException
QueryException
public java.lang.String buildLimit(ILimit limit) throws QueryException
ISelectQueryCallback
buildLimit
in interface ISelectQueryCallback
buildLimit
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
ISelectQueryCallback#buildLimit(ILimit)
public java.lang.String buildLimit(ISelectQuery selectQuery) throws QueryException
ISelectQueryCallback
buildLimit
in interface ISelectQueryCallback
buildLimit
in class com.ibm.websphere.query.callbacks.SelectQueryCallbackAdapter
QueryException
ISelectQueryCallback#buildLimit(ISelectQuery)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |