© 2004 BEA Systems, Inc.

com.bea.p13n.content.document.ref
Class StatementParams

java.lang.Object
  extended bycom.bea.p13n.content.document.ref.StatementParams

Deprecated. This class has been deprecated in favor of using a RefSQLGenerator instance configured as needed.

public class StatementParams
extends Object

A little holder class for the information required to create and execute a PreparedStatement, plus how to convert a Search/Expression into a StatementParams.

This class is specific to the table structure of the RefDocumentProvider.


Field Summary
static short AND_TYPE
          Deprecated. The LogicalAnd/LogicalMulitAnd expression type.
static short COLLECTION_CONTAINS_ALL_TYPE
          Deprecated. The CollectionContainsAll expression type.
static short COLLECTION_CONTAINS_TYPE
          Deprecated. The CollectionContains expression type.
static DateFormat dateFormat
          Deprecated. A date formatter for "MM/dd/yyyy HH:mm:ss z" (02/28/2000 15:58:35 MST).
static String DOC_MD_TABLE
          Deprecated. The document_metadata table name.
static String DOC_TABLE
          Deprecated. The document table name.
static short EQUALS_TYPE
          Deprecated. The Equals expression type.
static short GREATER_OR_EQUALS_TYPE
          Deprecated. The GreaterOrEquals expression type.
static short GREATER_THAN_TYPE
          Deprecated. The GreaterThan expression type.
static short LESS_OR_EQUALS_TYPE
          Deprecated. The LessOrEquals expression type.
static short LESS_THAN_TYPE
          Deprecated. The LessThan expression type.
static short LIKE_TYPE
          Deprecated. The StringLike expression type.
 long maxReturn
          Deprecated. The max number to return (0 or less for all).
static short NOT_EQUALS_TYPE
          Deprecated. The NotEquals expression type.
static short NOT_TYPE
          Deprecated. The LogicalNot expression type.
static short OR_TYPE
          Deprecated. The LogicalOr/LogicalMulitOr expression type.
 List params
          Deprecated. The list of input parameters that match up with the SQL string.
 SortCriteria[] sortCriteria
          Deprecated. The list of SortCriteria needing to be applied.
 String sql
          Deprecated. The SQL string.
 
Constructor Summary
StatementParams()
          Deprecated.  
 
Method Summary
protected static void createBranchStatementParams(StringBuffer buf, Expression expr, List params, boolean supportsLikeEscapeClause)
          Deprecated. Utility to convert a branch expression into a SQL expression.
protected static void createLeafStatementParams(StringBuffer buf, Expression expr, List params, boolean supportsLikeEscapeClause)
          Deprecated. Utility to convert a valid leaf Expression into a SQL expression.
protected static String createStatementParams(Expression expr, List params, boolean supportsLikeEscapeClause)
          Deprecated. Utility method to convert an Expression into a SQL expression.
protected static void createStatementParams(StringBuffer buf, Expression expr, List params, boolean supportsLikeEscapeClause)
          Deprecated. Utility method to convert an Expression into a SQL expression.
static String getExpressionString(short type)
          Deprecated. Get the expression string for the specified expression type.
static short getExpressionType(Expression expr)
          Deprecated. Get a type constant for the given expression.
protected static PropertyRef getLeftHandSide(Expression expr)
          Deprecated. Get the left-hand-side of an expression.
protected static Object getRightHandSide(Expression expr)
          Deprecated. Get the right-hand-side of an expression.
static String getSQLOperator(short type)
          Deprecated. Return the corresponding SQL operator for the given expression type.
static StatementParams getStatementParams(String baseSql, Search params, boolean supportsLikeEscapeClause)
          Deprecated. Utility method to get a StatementParams from Search params.
protected static Expression getSubExpression(Expression expr, int count)
          Deprecated. Get the specified subexpression.
static boolean isLegalSingleValueExpressionType(short type)
          Deprecated. Determine if a comparator is legal, single-value attribute comparator.
 PreparedStatement prepare(Connection con)
          Deprecated. Prepare a statement from our sql and input params on the given database connection.
 void sort(List list)
          Deprecated. Sort a list of DocumentMetadataDefs based upon our sort criteria.
static Object toSQLLike(Object obj, boolean supportsLikeEscapeClause)
          Deprecated. Convert an object, which might be a string, to a SQL like string.
static String toSQLLike(String like, boolean supportsLikeEscapeClause)
          Deprecated. Convert a query LIKE value to a SQL LIKE value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND_TYPE

public static final short AND_TYPE
Deprecated. 
The LogicalAnd/LogicalMulitAnd expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

COLLECTION_CONTAINS_ALL_TYPE

public static final short COLLECTION_CONTAINS_ALL_TYPE
Deprecated. 
The CollectionContainsAll expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

COLLECTION_CONTAINS_TYPE

public static final short COLLECTION_CONTAINS_TYPE
Deprecated. 
The CollectionContains expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

dateFormat

public static final DateFormat dateFormat
Deprecated. 
A date formatter for "MM/dd/yyyy HH:mm:ss z" (02/28/2000 15:58:35 MST).


DOC_MD_TABLE

public static final String DOC_MD_TABLE
Deprecated. 
The document_metadata table name.

See Also:
RefDocumentProvider.DOC_MD_TABLE, Constant Field Values

DOC_TABLE

public static final String DOC_TABLE
Deprecated. 
The document table name.

See Also:
RefDocumentProvider.DOC_TABLE, Constant Field Values

EQUALS_TYPE

public static final short EQUALS_TYPE
Deprecated. 
The Equals expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

GREATER_OR_EQUALS_TYPE

public static final short GREATER_OR_EQUALS_TYPE
Deprecated. 
The GreaterOrEquals expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

GREATER_THAN_TYPE

public static final short GREATER_THAN_TYPE
Deprecated. 
The GreaterThan expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

LESS_OR_EQUALS_TYPE

public static final short LESS_OR_EQUALS_TYPE
Deprecated. 
The LessOrEquals expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

LESS_THAN_TYPE

public static final short LESS_THAN_TYPE
Deprecated. 
The LessThan expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

LIKE_TYPE

public static final short LIKE_TYPE
Deprecated. 
The StringLike expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

maxReturn

public long maxReturn
Deprecated. 
The max number to return (0 or less for all).


NOT_EQUALS_TYPE

public static final short NOT_EQUALS_TYPE
Deprecated. 
The NotEquals expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

NOT_TYPE

public static final short NOT_TYPE
Deprecated. 
The LogicalNot expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

OR_TYPE

public static final short OR_TYPE
Deprecated. 
The LogicalOr/LogicalMulitOr expression type.

See Also:
getExpressionType(com.bea.p13n.expression.Expression), Constant Field Values

params

public List params
Deprecated. 
The list of input parameters that match up with the SQL string.


sortCriteria

public SortCriteria[] sortCriteria
Deprecated. 
The list of SortCriteria needing to be applied.

This will be null or empty if no additional sorting is required.


sql

public String sql
Deprecated. 
The SQL string.

Constructor Detail

StatementParams

public StatementParams()
Deprecated. 
Method Detail

createBranchStatementParams

protected static void createBranchStatementParams(StringBuffer buf,
                                                  Expression expr,
                                                  List params,
                                                  boolean supportsLikeEscapeClause)
                                           throws DocumentException
Deprecated. 
Utility to convert a branch expression into a SQL expression.

Parameters:
buf - the string buffer to write into.
expr - the branch expression.
params - the prepared statement input parameters list (will be appended to).
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
Returns:
the SQL expression (no WHERE, no SELECT).
Throws:
DocumentException - thrown on invalid expression data.

createLeafStatementParams

protected static void createLeafStatementParams(StringBuffer buf,
                                                Expression expr,
                                                List params,
                                                boolean supportsLikeEscapeClause)
                                         throws DocumentException
Deprecated. 
Utility to convert a valid leaf Expression into a SQL expression.

Parameters:
buf - the string buffer to write into.
expr - the expression object.
params - the prepared statement input parameters list (will be appended to).
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
Returns:
the SQL expression (no WHERE, no SELECT).
Throws:
DocumentException - thrown on invalid expression data.

createStatementParams

protected static String createStatementParams(Expression expr,
                                              List params,
                                              boolean supportsLikeEscapeClause)
                                       throws DocumentException
Deprecated. 
Utility method to convert an Expression into a SQL expression.

Parameters:
expr - the expression object.
params - the prepared statement input parameters list (will be appended to).
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
Returns:
the SQL expression (no WHERE, no SELECT).
Throws:
DocumentException - thrown on invalid expression data.

createStatementParams

protected static void createStatementParams(StringBuffer buf,
                                            Expression expr,
                                            List params,
                                            boolean supportsLikeEscapeClause)
                                     throws DocumentException
Deprecated. 
Utility method to convert an Expression into a SQL expression.

Parameters:
buf - the string buffer to write into.
expr - the expression object.
params - the prepared statement input parameters list (will be appended to).
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
Returns:
the SQL expression (no WHERE, no SELECT).
Throws:
DocumentException - thrown on invalid expression data.

getExpressionString

public static String getExpressionString(short type)
                                  throws DocumentException
Deprecated. 
Get the expression string for the specified expression type.

Throws:
DocumentException
See Also:
NOT_EQUALS_TYPE, EQUALS_TYPE, GREATER_THAN_TYPE, LESS_THAN_TYPE, GREATER_OR_EQUALS_TYPE, LESS_OR_EQUALS_TYPE, LIKE_TYPE, COLLECTION_CONTAINS_TYPE, COLLECTION_CONTAINS_ALL_TYPE, AND_TYPE, OR_TYPE, NOT_TYPE

getExpressionType

public static short getExpressionType(Expression expr)
                               throws DocumentException
Deprecated. 
Get a type constant for the given expression.

Throws:
DocumentException
See Also:
NOT_EQUALS_TYPE, EQUALS_TYPE, GREATER_THAN_TYPE, LESS_THAN_TYPE, GREATER_OR_EQUALS_TYPE, LESS_OR_EQUALS_TYPE, LIKE_TYPE, COLLECTION_CONTAINS_TYPE, COLLECTION_CONTAINS_ALL_TYPE, AND_TYPE, OR_TYPE, NOT_TYPE

getLeftHandSide

protected static PropertyRef getLeftHandSide(Expression expr)
                                      throws DocumentException
Deprecated. 
Get the left-hand-side of an expression.

Throws:
DocumentException - thrown on invalid expression.
See Also:
ExpressionHelper.getLeftHandSide(com.bea.p13n.expression.Expression)

getRightHandSide

protected static Object getRightHandSide(Expression expr)
                                  throws DocumentException
Deprecated. 
Get the right-hand-side of an expression.

Throws:
DocumentException - thrown on invalid expression.
See Also:
ExpressionHelper.getRightHandSide(com.bea.p13n.expression.Expression)

getSQLOperator

public static String getSQLOperator(short type)
                             throws DocumentException
Deprecated. 
Return the corresponding SQL operator for the given expression type.

Throws:
DocumentException

getStatementParams

public static StatementParams getStatementParams(String baseSql,
                                                 Search params,
                                                 boolean supportsLikeEscapeClause)
                                          throws DocumentException
Deprecated. 
Utility method to get a StatementParams from Search params.

Parameters:
baseSql - the base select part of the sql (no from, no where, "doc" is document table, "md" is document_metadata table).
params - the list to add the prepared statement parameters to.
supportsLikeEscapeClause - tells if the SQL statement can use the LIKE ESCAPE clause.
Throws:
DocumentException

getSubExpression

protected static Expression getSubExpression(Expression expr,
                                             int count)
                                      throws DocumentException
Deprecated. 
Get the specified subexpression.

Throws:
DocumentException - thrown on invalid expression.
See Also:
ExpressionHelper.getSubExpression(com.bea.p13n.expression.Expression, int)

isLegalSingleValueExpressionType

public static boolean isLegalSingleValueExpressionType(short type)
Deprecated. 
Determine if a comparator is legal, single-value attribute comparator.


prepare

public PreparedStatement prepare(Connection con)
                          throws SQLException
Deprecated. 
Prepare a statement from our sql and input params on the given database connection.

Throws:
SQLException

sort

public void sort(List list)
          throws DocumentException
Deprecated. 
Sort a list of DocumentMetadataDefs based upon our sort criteria.

Throws:
DocumentException

toSQLLike

public static Object toSQLLike(Object obj,
                               boolean supportsLikeEscapeClause)
Deprecated. 
Convert an object, which might be a string, to a SQL like string.


toSQLLike

public static String toSQLLike(String like,
                               boolean supportsLikeEscapeClause)
Deprecated. 
Convert a query LIKE value to a SQL LIKE value.


© 2004 BEA Systems, Inc.

Copyright © 2004 BEA Systems, Inc. All Rights Reserved