|
© 2003 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.p13n.content.document.ref.StatementParams
RefSQLGenerator
instance configured as needed.
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 |
public static final String DOC_TABLE
RefDocumentProvider.DOC_TABLE
,
Constant Field Valuespublic static final String DOC_MD_TABLE
RefDocumentProvider.DOC_MD_TABLE
,
Constant Field Valuespublic static final short NOT_EQUALS_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short EQUALS_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short GREATER_THAN_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short LESS_THAN_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short GREATER_OR_EQUALS_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short LESS_OR_EQUALS_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short LIKE_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short COLLECTION_CONTAINS_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short COLLECTION_CONTAINS_ALL_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short AND_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short OR_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final short NOT_TYPE
getExpressionType(com.bea.p13n.expression.Expression)
,
Constant Field Valuespublic static final DateFormat dateFormat
public String sql
public long maxReturn
public List params
public SortCriteria[] sortCriteria
This will be null or empty if no additional sorting is required.
Constructor Detail |
public StatementParams()
Method Detail |
public PreparedStatement prepare(Connection con) throws SQLException
SQLException
public void sort(List list) throws DocumentException
DocumentException
public static StatementParams getStatementParams(String baseSql, Search params, boolean supportsLikeEscapeClause) throws DocumentException
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.
DocumentException
protected static String createStatementParams(Expression expr, List params, boolean supportsLikeEscapeClause) throws DocumentException
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.
DocumentException
- thrown on invalid expression data.protected static void createStatementParams(StringBuffer buf, Expression expr, List params, boolean supportsLikeEscapeClause) throws DocumentException
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.
DocumentException
- thrown on invalid expression data.protected static Expression getSubExpression(Expression expr, int count) throws DocumentException
DocumentException
- thrown on invalid expression.ExpressionHelper.getSubExpression(com.bea.p13n.expression.Expression, int)
protected static PropertyRef getLeftHandSide(Expression expr) throws DocumentException
DocumentException
- thrown on invalid expression.ExpressionHelper.getLeftHandSide(com.bea.p13n.expression.Expression)
protected static Object getRightHandSide(Expression expr) throws DocumentException
DocumentException
- thrown on invalid expression.ExpressionHelper.getRightHandSide(com.bea.p13n.expression.Expression)
protected static void createLeafStatementParams(StringBuffer buf, Expression expr, List params, boolean supportsLikeEscapeClause) throws DocumentException
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.
DocumentException
- thrown on invalid expression data.protected static void createBranchStatementParams(StringBuffer buf, Expression expr, List params, boolean supportsLikeEscapeClause) throws DocumentException
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.
DocumentException
- thrown on invalid expression data.public static short getExpressionType(Expression expr) throws DocumentException
DocumentException
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
public static String getExpressionString(short type) throws DocumentException
DocumentException
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
public static boolean isLegalSingleValueExpressionType(short type)
public static String getSQLOperator(short type) throws DocumentException
DocumentException
public static String toSQLLike(String like, boolean supportsLikeEscapeClause)
public static Object toSQLLike(Object obj, boolean supportsLikeEscapeClause)
|
© 2003 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |