Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.2.0)

E17483-03


oracle.jbo.common
Class CommonCriteriaAdapter

java.lang.Object
  extended by oracle.jbo.common.CommonCriteriaAdapter

All Implemented Interfaces:
CriteriaAdapter
Direct Known Subclasses:
CriteriaAdapterImpl

public abstract class CommonCriteriaAdapter
extends java.lang.Object
implements CriteriaAdapter

Field Summary
static java.lang.String BETWEEN
           
static java.lang.String IN
           
static java.lang.String IS
           
static java.lang.String LIKE
           
static java.lang.String LIKE_QOT
           
static java.lang.String NOT
           
static java.lang.String NULL
           
static char QOT
           
static java.lang.String QOTSTR
           

 

Constructor Summary
CommonCriteriaAdapter()
           

 

Method Summary
 void cleanUpTemporaryBindVariables(ViewCriteria criteria)
          Removes the temporary bind variables created to hold the view criteria item literal values.
protected  void cleanUpTemporaryBindVars(ViewCriteria criteria)
          Deprecated. Use cleanUpTemporaryBindVariables(oracle.jbo.ViewCriteria) public method instead.
protected  java.lang.String convertCriteriaItemToWhereFragment(ViewCriteria criteria, ViewCriteriaRow row, int attrIndex, boolean firstClause)
           
protected  java.lang.String convertOpandRHSToWhereFragment(ViewCriteria vc, ViewCriteriaItem vci, java.lang.String operator, java.lang.Object value, boolean isBindVarOrSqlFragment)
           
protected  java.lang.Object convertValueToWhereFragment(ViewCriteria vc, ViewCriteriaItem curDef, java.lang.String trimmedValue)
           
protected  java.lang.String correctOprandLiteral(java.lang.String restVal)
           
protected  java.lang.String createTempBindVar(ViewCriteria criteria, ViewCriteriaItem vcItem, int valueIndex)
          Deprecated. Use createTemporaryBindVar(oracle.jbo.ViewCriteria, oracle.jbo.ViewCriteriaItem, int) from the client code.
 java.lang.String createTemporaryBindVar(ViewCriteria criteria, ViewCriteriaItem vcItem, int valueIndex)
          Create temporary bind variable for a view criteria item value for useBindVarsOnly mode for binding literal values defined in the view criteria item.
protected  java.lang.String doConvertCriteriaItemToWhereFragment(ViewCriteria criteria, ViewCriteriaRow row, ViewCriteriaItem critItem, int attrIndex, boolean firstClause)
           
protected abstract  java.lang.Object formatAttributeValue(ViewCriteria vc, AttributeDef curDef, java.lang.String valString)
           
protected  java.util.HashMap getBindValsForSqlGen(ViewCriteria vc)
           
protected  java.lang.String getCriteriaClause(AttributeDef[] attrDefs, ViewCriteria criteria)
          Generate a where clause fragment for the view criteria.
 java.lang.String getCriteriaClause(ViewCriteria criteria)
          Generate a where clause fragment for the view criteria.
protected  java.lang.String getEscapeClause(boolean forQuery)
           
protected  java.lang.String getFormattedLHSCompareFragment(AttributeDef attrDef, int sqlType, java.lang.String lhs, java.lang.Object rhs)
           
protected  java.lang.String getFormattedLHSCompareFragment(ViewCriteria vc, AttributeDef attrDef, int sqlType, java.lang.String lhs, java.lang.Object rhs)
           
protected  java.lang.String getFormattedRHSCompareFragment(ViewCriteria vc, AttributeDef attrDef, int sqlType, java.lang.String rhs)
           
protected  java.lang.String getOptionalItemClause(ViewCriteria vc, ViewCriteriaItem vci)
          Returns any additional clause to be added to the where clause for optional view criteria item if there is any.
protected  RowSet getRowSetForSqlGen(ViewCriteria vc)
           
protected  java.lang.String getStringConcatOper(boolean bIncludeSpaces)
           
protected  java.lang.String getWhereFragmentFromVO(ViewCriteria criteria, ViewCriteriaItem vci)
           
protected  java.lang.String getWildCardEscapeVal(java.lang.String val, boolean isBindVarVal, boolean forQuery)
           
 boolean isCharType(int type)
           
 boolean isDateType(int type)
           
protected  boolean isLHSFragmentOptional(ViewCriteria vc, AttributeDef attrDef, java.lang.String lhs)
           
 boolean isNumericType(int type)
           
protected  ViewCriteriaItem parseOperatorAndValueFromItemValue(ViewCriteria vc, ViewCriteriaItem vci)
           
protected  java.lang.String replaceSQLDerivedAttrTableAlias(ViewCriteria vc, java.lang.String sqlExpr, java.lang.String aliasSuffix)
          replaceSQLDerivedColumnAttrAlias is overridden in BaseSqlBuilderImpl to properly replace all table alias references for a SQL derived attribute with ones containing the appropriate suffix for the subquery.
protected  java.lang.String setupBindVarExtendedData(ViewCriteria criteria, java.lang.String criteriaClause)
          Subclasses should overwrite this method if it needs to set up extended data for bind variables for JDBC positional binding style, and to replace the name bind variables in the where clause if necessary.
protected  boolean shouldUseTempBindVariableForValue(ViewCriteria criteria, ViewCriteriaItem vci)
          Allow subclasses to override the useBindVarsOnly mode for the given view criteria item.If view criteria is in useBindVarsOnly mode,

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

QOT

public static final char QOT
See Also:
Constant Field Values

QOTSTR

public static final java.lang.String QOTSTR
See Also:
Constant Field Values

LIKE_QOT

public static final java.lang.String LIKE_QOT
See Also:
Constant Field Values

LIKE

public static final java.lang.String LIKE
See Also:
Constant Field Values

IS

public static final java.lang.String IS
See Also:
Constant Field Values

IN

public static final java.lang.String IN
See Also:
Constant Field Values

NOT

public static final java.lang.String NOT
See Also:
Constant Field Values

NULL

public static final java.lang.String NULL
See Also:
Constant Field Values

BETWEEN

public static final java.lang.String BETWEEN
See Also:
Constant Field Values

Constructor Detail

CommonCriteriaAdapter

public CommonCriteriaAdapter()

Method Detail

formatAttributeValue

protected abstract java.lang.Object formatAttributeValue(ViewCriteria vc,
                                                         AttributeDef curDef,
                                                         java.lang.String valString)

setupBindVarExtendedData

protected java.lang.String setupBindVarExtendedData(ViewCriteria criteria,
                                                    java.lang.String criteriaClause)
Subclasses should overwrite this method if it needs to set up extended data for bind variables for JDBC positional binding style, and to replace the name bind variables in the where clause if necessary.
Parameters:
criteria - The view criteria that we are building the where clause for
criteriaClause - The where clause that has been generated
Returns:
The where clause to be used by the statement

cleanUpTemporaryBindVariables

public void cleanUpTemporaryBindVariables(ViewCriteria criteria)
Removes the temporary bind variables created to hold the view criteria item literal values.
Parameters:
criteria - ViewCriteria containing the view criteria item

cleanUpTemporaryBindVars

protected void cleanUpTemporaryBindVars(ViewCriteria criteria)
Deprecated. Use cleanUpTemporaryBindVariables(oracle.jbo.ViewCriteria) public method instead.
Removes the temporary bind variables created to hold the view criteria item literal values.
Parameters:
criteria - ViewCriteria containing the view criteria item

getCriteriaClause

public java.lang.String getCriteriaClause(ViewCriteria criteria)
Generate a where clause fragment for the view criteria. A view criteria may have one or more view criteria rows, nested view criteria or view criteria usages. This method is only invoked once per root view criteria. getCriteriaClause(oracle.jbo.AttributeDef[], oracle.jbo.ViewCriteria) is invoked for a root view criteria as well as nested view criteria.
Specified by:
getCriteriaClause in interface CriteriaAdapter
Parameters:
criteria - a view criteria instance
Returns:
a where clause fragment

getCriteriaClause

protected java.lang.String getCriteriaClause(AttributeDef[] attrDefs,
                                             ViewCriteria criteria)
Generate a where clause fragment for the view criteria. A view criteria may have one or more view criteria rows, nested view criteria or view criteria usages. This method is called recursively for each nested view criteria and view criteria usage.
Parameters:
attrDefs - attribute definitions in the structure def that owns the criteria.
criteria - a view criteria instance
Returns:
a where clause fragment

getWhereFragmentFromVO

protected java.lang.String getWhereFragmentFromVO(ViewCriteria criteria,
                                                  ViewCriteriaItem vci)

shouldUseTempBindVariableForValue

protected boolean shouldUseTempBindVariableForValue(ViewCriteria criteria,
                                                    ViewCriteriaItem vci)
Allow subclasses to override the useBindVarsOnly mode for the given view criteria item.If view criteria is in useBindVarsOnly mode,
Parameters:
criteria -
vci -
Returns:
true if temporary bind variables should be added for literal values, false if literal values should be added to the where clause as is.

createTemporaryBindVar

public java.lang.String createTemporaryBindVar(ViewCriteria criteria,
                                               ViewCriteriaItem vcItem,
                                               int valueIndex)
Create temporary bind variable for a view criteria item value for useBindVarsOnly mode for binding literal values defined in the view criteria item. The temporary bind variables are cleaned out during the generation of the criteria clause in getCriteriaClause.
Parameters:
criteria - ViewCriteria containing the view criteria item
vcItem - ViewCriteriaItem containing the value for which temporary bind variable is to be created for.
valueIndex - The value for which temporary bind variable is to be created for.
Returns:
The name of the temporary bind variable created.

createTempBindVar

protected java.lang.String createTempBindVar(ViewCriteria criteria,
                                             ViewCriteriaItem vcItem,
                                             int valueIndex)
Deprecated. Use createTemporaryBindVar(oracle.jbo.ViewCriteria, oracle.jbo.ViewCriteriaItem, int) from the client code.
Create temporary bind variable for a view criteria item value for useBindVarsOnly mode for binding literal values defined in the view criteria item. The temporary bind variables are cleaned out during the generation of the criteria clause in getCriteriaClause.
Returns:
The name of the temporary bind variable created.

convertCriteriaItemToWhereFragment

protected java.lang.String convertCriteriaItemToWhereFragment(ViewCriteria criteria,
                                                              ViewCriteriaRow row,
                                                              int attrIndex,
                                                              boolean firstClause)

doConvertCriteriaItemToWhereFragment

protected java.lang.String doConvertCriteriaItemToWhereFragment(ViewCriteria criteria,
                                                                ViewCriteriaRow row,
                                                                ViewCriteriaItem critItem,
                                                                int attrIndex,
                                                                boolean firstClause)

replaceSQLDerivedAttrTableAlias

protected java.lang.String replaceSQLDerivedAttrTableAlias(ViewCriteria vc,
                                                           java.lang.String sqlExpr,
                                                           java.lang.String aliasSuffix)
replaceSQLDerivedColumnAttrAlias is overridden in BaseSqlBuilderImpl to properly replace all table alias references for a SQL derived attribute with ones containing the appropriate suffix for the subquery.
Parameters:
vc - The view criteria we are building SQL for.
sqlExpr - The SQL expression of the SQL derived attribute.
aliasSuffix - The subquery specific alias suffix.
Returns:
The modified SQL for the SQL derived attribute with the appropriate aliases.

correctOprandLiteral

protected java.lang.String correctOprandLiteral(java.lang.String restVal)

getStringConcatOper

protected java.lang.String getStringConcatOper(boolean bIncludeSpaces)

getOptionalItemClause

protected java.lang.String getOptionalItemClause(ViewCriteria vc,
                                                 ViewCriteriaItem vci)
Returns any additional clause to be added to the where clause for optional view criteria item if there is any. for example: "OR :var1 IS NULL"
Parameters:
vc - ViewCriteria containing the view criteria item
vci - ViewCriteriaItem for which a clause for the optional clause is to be constructed. The ViewCriteriaItem passed is either a selectively required item or an optional item, but not a required item.
Returns:
A String to be added to the where clause for an optional view criteria item.

convertOpandRHSToWhereFragment

protected java.lang.String convertOpandRHSToWhereFragment(ViewCriteria vc,
                                                          ViewCriteriaItem vci,
                                                          java.lang.String operator,
                                                          java.lang.Object value,
                                                          boolean isBindVarOrSqlFragment)

getRowSetForSqlGen

protected RowSet getRowSetForSqlGen(ViewCriteria vc)

getBindValsForSqlGen

protected java.util.HashMap getBindValsForSqlGen(ViewCriteria vc)

parseOperatorAndValueFromItemValue

protected ViewCriteriaItem parseOperatorAndValueFromItemValue(ViewCriteria vc,
                                                              ViewCriteriaItem vci)

convertValueToWhereFragment

protected java.lang.Object convertValueToWhereFragment(ViewCriteria vc,
                                                       ViewCriteriaItem curDef,
                                                       java.lang.String trimmedValue)

getFormattedRHSCompareFragment

protected java.lang.String getFormattedRHSCompareFragment(ViewCriteria vc,
                                                          AttributeDef attrDef,
                                                          int sqlType,
                                                          java.lang.String rhs)

getFormattedLHSCompareFragment

protected java.lang.String getFormattedLHSCompareFragment(ViewCriteria vc,
                                                          AttributeDef attrDef,
                                                          int sqlType,
                                                          java.lang.String lhs,
                                                          java.lang.Object rhs)

getFormattedLHSCompareFragment

protected java.lang.String getFormattedLHSCompareFragment(AttributeDef attrDef,
                                                          int sqlType,
                                                          java.lang.String lhs,
                                                          java.lang.Object rhs)

isLHSFragmentOptional

protected boolean isLHSFragmentOptional(ViewCriteria vc,
                                        AttributeDef attrDef,
                                        java.lang.String lhs)

isCharType

public boolean isCharType(int type)

isDateType

public boolean isDateType(int type)

isNumericType

public boolean isNumericType(int type)

getWildCardEscapeVal

protected java.lang.String getWildCardEscapeVal(java.lang.String val,
                                                boolean isBindVarVal,
                                                boolean forQuery)

getEscapeClause

protected java.lang.String getEscapeClause(boolean forQuery)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.2.0)

E17483-03


Copyright © 1997, 2012, Oracle. All rights reserved.