com.beasys.commerce.ebusiness.catalog.service.query
Class QueryHelper

java.lang.Object
  extended by com.beasys.commerce.ebusiness.catalog.service.query.QueryHelper

Deprecated See BEA Commerce product offering

@Deprecated
public class QueryHelper
extends Object

Helper class for performing Product Catalog queries.


Field Summary
static String DEFAULT_ENTITY_ID_TABLE_NAME
          Deprecated See BEA Commerce product offering
static String DEFAULT_PROPERTY_BOOLEAN_COLUMN_NAME
          Deprecated See BEA Commerce product offering
static String DEFAULT_PROPERTY_DATETIME_COLUMN_NAME
          Deprecated See BEA Commerce product offering
static String DEFAULT_PROPERTY_FLOAT_COLUMN_NAME
          Deprecated See BEA Commerce product offering
static String DEFAULT_PROPERTY_ID_TABLE_NAME
          Deprecated See BEA Commerce product offering
static String DEFAULT_PROPERTY_INTEGER_COLUMN_NAME
          Deprecated See BEA Commerce product offering
static String DEFAULT_PROPERTY_TEXT_COLUMN_NAME
          Deprecated See BEA Commerce product offering
static String DEFAULT_PROPERTY_VALUE_TABLE
          Deprecated See BEA Commerce product offering
static String DEFAULT_TABLE_PREFIX
          Deprecated See BEA Commerce product offering
 
Constructor Summary
QueryHelper(JdbcCatalogFactory jdbcCatFac, Boolean supportsLikeEscapeClause)
          Deprecated See BEA Commerce product offering
 
Method Summary
static List fixKeywords(String[] keywords)
          Deprecated See BEA Commerce product offering
protected  StringBuffer getSearchSQL(boolean showAll, List params, boolean isCategory)
          Deprecated See BEA Commerce product offering
protected  StringBuffer getSearchSQL(Expression expr, String prefix, boolean supportsLikeEscapeClause, List params, boolean isCategory)
          Deprecated See BEA Commerce product offering
protected  StringBuffer getSearchSQL(List keywords, String logical, List params)
          Deprecated See BEA Commerce product offering
protected  void getSearchSQL(StringBuffer buf, Criteria c, String prefix, boolean supportsLikeEscapeClause, List params, boolean isCategory)
          Deprecated See BEA Commerce product offering
protected  void getSearchSQL(StringBuffer buf, Expression expr, String prefix, boolean supportsLikeEscapeClause, List params, boolean isCategory)
          Deprecated See BEA Commerce product offering
protected  void getSearchSQL(StringBuffer buf, Logical l, String prefix, boolean supportsLikeEscapeClause, List params, boolean isCategory)
          Deprecated See BEA Commerce product offering
protected  void getSearchSQL(StringBuffer buf, String prefix, boolean supportsLikeEscapeClause, String column, String scope, String name, String op, Object val, List params, boolean isCategory)
          Deprecated See BEA Commerce product offering
protected  StringBuffer getSearchSQL(String lang, List params, boolean isCategory)
          Deprecated See BEA Commerce product offering
static String getSQLOperator(String c)
          Deprecated See BEA Commerce product offering
static boolean isLegalSingleValueComparator(String c)
          Deprecated See BEA Commerce product offering
static void main(String[] args)
          Deprecated See BEA Commerce product offering
 List search(Connection con, boolean showAll, String lang, Expression expr, String tablePrefix)
          Deprecated See BEA Commerce product offering
 List search(Connection con, boolean showAll, String lang, List keywords)
          Deprecated See BEA Commerce product offering
 List search(Connection con, boolean showAll, String lang, List keywords, String logical)
          Deprecated See BEA Commerce product offering
 List search(Connection con, boolean showAll, String lang, List keywords, String logical, Expression expr, String tablePrefix, int maxSearchResults)
          Deprecated See BEA Commerce product offering
 List search(Connection con, boolean showAll, String lang, String logical, Expression expr, String tablePrefix, int maxSearchResults)
          Deprecated See BEA Commerce product offering
static Object toSQLLike(Object obj, boolean supportsLikeEscapeClause)
          Deprecated See BEA Commerce product offering
static String toSQLLike(String like, boolean supportsLikeEscapeClause)
          Deprecated See BEA Commerce product offering
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENTITY_ID_TABLE_NAME

public static final String DEFAULT_ENTITY_ID_TABLE_NAME
Deprecated See BEA Commerce product offering
The default entity identifier table

See Also
Constants Summary

DEFAULT_PROPERTY_ID_TABLE_NAME

public static final String DEFAULT_PROPERTY_ID_TABLE_NAME
Deprecated See BEA Commerce product offering
The default property identifier table

See Also
Constants Summary

DEFAULT_PROPERTY_VALUE_TABLE

public static final String DEFAULT_PROPERTY_VALUE_TABLE
Deprecated See BEA Commerce product offering
The default property table

See Also
Constants Summary

DEFAULT_PROPERTY_BOOLEAN_COLUMN_NAME

public static final String DEFAULT_PROPERTY_BOOLEAN_COLUMN_NAME
Deprecated See BEA Commerce product offering
The default boolean property table

See Also
Constants Summary

DEFAULT_PROPERTY_INTEGER_COLUMN_NAME

public static final String DEFAULT_PROPERTY_INTEGER_COLUMN_NAME
Deprecated See BEA Commerce product offering
The default integer property table

See Also
Constants Summary

DEFAULT_PROPERTY_FLOAT_COLUMN_NAME

public static final String DEFAULT_PROPERTY_FLOAT_COLUMN_NAME
Deprecated See BEA Commerce product offering
The default float property table

See Also
Constants Summary

DEFAULT_PROPERTY_TEXT_COLUMN_NAME

public static final String DEFAULT_PROPERTY_TEXT_COLUMN_NAME
Deprecated See BEA Commerce product offering
The default text property table

See Also
Constants Summary

DEFAULT_PROPERTY_DATETIME_COLUMN_NAME

public static final String DEFAULT_PROPERTY_DATETIME_COLUMN_NAME
Deprecated See BEA Commerce product offering
The default date/time property table

See Also
Constants Summary

DEFAULT_TABLE_PREFIX

public static final String DEFAULT_TABLE_PREFIX
Deprecated See BEA Commerce product offering
The default table prefix

See Also
Constants Summary
Constructor Detail

QueryHelper

public QueryHelper(JdbcCatalogFactory jdbcCatFac,
                   Boolean supportsLikeEscapeClause)
Deprecated See BEA Commerce product offering

Method Detail

fixKeywords

public static List fixKeywords(String[] keywords)
Deprecated See BEA Commerce product offering

Fix up an array of keywords by removing nulls and duplicates.

Parameters
keywords - the array of keywords.
Returns
the cleaned-up list of keywords.

search

public List search(Connection con,
                   boolean showAll,
                   String lang,
                   String logical,
                   Expression expr,
                   String tablePrefix,
                   int maxSearchResults)
            throws CatalogException
Deprecated See BEA Commerce product offering

Perform a search

Parameters
con - the database connection to use.
showAll - true to show invisible items, false to not.
lang - the language to match on (null for any).
keywords - the list of keywords (no nulls, no duplicates, null for none).
logical - TypesHelper.AND or TypesHelper.OR (for keywords).
expr - the query expression to use (already normalized, null for none).
tablePrefix - the table prefix for the ConfigurableEntity tables for implicit properties.
Returns
the list of ProductItemKeys of the items that match.
Throws
CatalogException
See Also
TypesHelper

search

public List search(Connection con,
                   boolean showAll,
                   String lang,
                   List keywords,
                   String logical,
                   Expression expr,
                   String tablePrefix,
                   int maxSearchResults)
            throws CatalogException
Deprecated See BEA Commerce product offering

Perform a search

Parameters
con - the database connection to use.
showAll - true to show invisible items, false to not.
lang - the language to match on (null for any).
keywords - the list of keywords (no nulls, no duplicates, null for none).
logical - TypesHelper.AND or TypesHelper.OR (for keywords).
expr - the query expression to use (already normalized, null for none).
tablePrefix - the table prefix for the ConfigurableEntity tables for implicit properties.
Returns
the list of ProductItemKeys of the items that match.
Throws
CatalogException
See Also
TypesHelper

search

public List search(Connection con,
                   boolean showAll,
                   String lang,
                   List keywords,
                   String logical)
            throws CatalogException
Deprecated See BEA Commerce product offering

Perform a keyword search.

Parameters
con - the database connection to use.
showAll - true to show invisible items, false to not.
lang - the language to match on (null for any).
keywords - the list of keywords (no nulls, no duplicates).
logical - TypesHelper.AND or TypesHelper.OR.
Returns
the list of ProductItemKeys of the items that match.
Throws
CatalogException

search

public List search(Connection con,
                   boolean showAll,
                   String lang,
                   List keywords)
            throws CatalogException
Deprecated See BEA Commerce product offering

Perform an AND'ed keyword search.

Parameters
con - the database connection to use.
showAll - true to show invisible items, false to not.
lang - the language to match on (null for any).
keywords - the list of keywords (no nulls, no duplicates).
Returns
the list of ProductItemKeys of the items that match.
Throws
CatalogException

search

public List search(Connection con,
                   boolean showAll,
                   String lang,
                   Expression expr,
                   String tablePrefix)
            throws CatalogException
Deprecated See BEA Commerce product offering

Perform an expression search.

Parameters
con - the database connection to use.
showAll - true to show invisible items, false to not.
lang - the language to match on (null for any).
expr - the normalized expression to use.
tablePrefix - the table prefix for the ConfigurableEntity tables for implicit properties.
Returns
the list of ProductItemKeys of the items that match.
Throws
CatalogException

getSearchSQL

protected StringBuffer getSearchSQL(boolean showAll,
                                    List params,
                                    boolean isCategory)
Deprecated See BEA Commerce product offering

Get the SQL where clause for the showAll parameter.

Parameters
showAll - whether to show invisible items (true), or not (false).
params - the list of prepared statement params to add to.
Returns
the SQL where clause, or null if there shouldn't be one.

getSearchSQL

protected StringBuffer getSearchSQL(String lang,
                                    List params,
                                    boolean isCategory)
Deprecated See BEA Commerce product offering

Get the SQL where clause for the lang parameter.

Parameters
showAll - the lang (null for none).
params - the list of prepared statement params to add to.
Returns
the SQL where clause, or null if there shouldn't be one.

getSearchSQL

protected StringBuffer getSearchSQL(List keywords,
                                    String logical,
                                    List params)
Deprecated See BEA Commerce product offering

Get the SQL where clause for the keywords.

Parameters
keywords - the list of keywords (no nulls, no duplicates, null for none).
logical - TypesHelper.AND or TypesHelper.OR (for keywords).
params - the list of prepared statement params to add to.
Returns
the SQL where clause, or null if there shouldn't be one.

getSearchSQL

protected StringBuffer getSearchSQL(Expression expr,
                                    String prefix,
                                    boolean supportsLikeEscapeClause,
                                    List params,
                                    boolean isCategory)
                             throws CatalogException
Deprecated See BEA Commerce product offering

Get the SQL where clause for an expression.

Parameters
expr - the expression (already normalized, null for none).
prefix - the table prefix for the ConfigurableEntity tables for implicit properties.
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
params - the list of prepared statement params to add to.
Returns
the SQL where clause, or null if there shouldn't be one.
Throws
CatalogException

getSearchSQL

protected void getSearchSQL(StringBuffer buf,
                            Expression expr,
                            String prefix,
                            boolean supportsLikeEscapeClause,
                            List params,
                            boolean isCategory)
                     throws CatalogException
Deprecated See BEA Commerce product offering

Get the SQL where clause for an expression.

Parameters
buf - the buffer to write into.
expr - the expression (already normalized, null for none).
prefix - the table prefix for the ConfigurableEntity tables for implicit properties.
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
params - the list of prepared statement params to add to.
Throws
CatalogException

getSearchSQL

protected void getSearchSQL(StringBuffer buf,
                            Criteria c,
                            String prefix,
                            boolean supportsLikeEscapeClause,
                            List params,
                            boolean isCategory)
                     throws CatalogException
Deprecated See BEA Commerce product offering

Get the SQL where clause for a Criteria.

Parameters
buf - the buffer to write into.
c - the Criteria.
prefix - the table prefix for the ConfigurableEntity tables for implicit properties.
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
params - the list of prepared statement params to add to.
Throws
CatalogException

getSearchSQL

protected void getSearchSQL(StringBuffer buf,
                            String prefix,
                            boolean supportsLikeEscapeClause,
                            String column,
                            String scope,
                            String name,
                            String op,
                            Object val,
                            List params,
                            boolean isCategory)
Deprecated See BEA Commerce product offering

Get the SQL for searching for an implicit property in a certain WLCS_PROP_* table.

Parameters
buf - the buffer to write into.
prefix - the table prefix.
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
table - the WLCS_PROP_* table name (e.g. WLCS_PROP_TEXT).
scope - the property scope name (null for any scope).
name - the property name.
op - the operator.
val - the value to match
params - the list of prepared statement params to add to.

getSearchSQL

protected void getSearchSQL(StringBuffer buf,
                            Logical l,
                            String prefix,
                            boolean supportsLikeEscapeClause,
                            List params,
                            boolean isCategory)
                     throws CatalogException
Deprecated See BEA Commerce product offering

Get the SQL where clause for a Criteria.

Parameters
buf - the buffer to write into.
l - the Logical.
prefix - the table prefix for the ConfigurableEntity tables for implicit properties.
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
params - the list of prepared statement params to add to.
Throws
CatalogException

isLegalSingleValueComparator

public static boolean isLegalSingleValueComparator(String c)
Deprecated See BEA Commerce product offering

Determine if a comparator is legal, single-value attribute comparator.


getSQLOperator

public static String getSQLOperator(String c)
Deprecated See BEA Commerce product offering

Return the corresponding SQL operator for the given comparator.

Parameters
op - the comparator (one from TypesHelper).

toSQLLike

public static String toSQLLike(String like,
                               boolean supportsLikeEscapeClause)
Deprecated See BEA Commerce product offering

Convert a query LIKE value to a SQL LIKE value.


toSQLLike

public static Object toSQLLike(Object obj,
                               boolean supportsLikeEscapeClause)
Deprecated See BEA Commerce product offering

Convert an object, which might be a string, to a SQL like string.


main

public static void main(String[] args)
                 throws Exception
Deprecated See BEA Commerce product offering

Quick unit test of keyword search.

Throws
Exception


Copyright © 2006 BEA Systems, Inc. All Rights Reserved