Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.5.0)

E10653-06


oracle.jbo
Class ViewCriteria

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by oracle.jbo.ViewCriteria

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess, ExprWrappable, NavigatableRowIterator, Properties, RowIterator, VariableManagerOwner, VariableManagerOwnerBase, ViewCriteriaComponent
Direct Known Subclasses:
ViewCriteriaImpl

public class ViewCriteria
extends java.util.Vector
implements NavigatableRowIterator, ViewCriteriaComponent, Properties, VariableManagerOwner

A declarative representation for a View Object's WHERE clause fragment.

The following example of a user-defined function, demoCriteria uses several methods in the ViewCriteria and ViewCriteriaRow classes to create and populate criteria rows and to demonstrate "query-by-example." The printViewObject is a helper function that executes the View Object query and prints the results to the screen.

    public static void demoCriteria(ApplicationModule appMod)
    {
       // Create and populate criteria rows to support query-by-example.
       ViewObject empView = appMod.createViewObject("Emp", "mypackage1.EmpView");
       ViewCriteria vc = empView.createViewCriteria();
       ViewCriteriaRow vcRow = vc.createViewCriteriaRow();

       // ViewCriteriaRow attribute name is case-sensitive.
       // ViewCriteriaRow attribute value requires operator and value.
       // Note also single-quotes around string value.
       ViewCriteriaItem jobItem = vcRow.ensureCriteriaItem("Job");
       jobItem.setOperator("=");
       jobItem.getValues().get(0).setValue("MANAGER");
       vc.add(vcRow);

       vcRow = vc.createViewCriteriaRow();
       ViewCriteriaItem salItem = vcRow.ensureCriteriaItem("Sal");
       salItem.setOperator(">");
       salItem.getValues().get(0).setValue(new Integer(2500));
       vc.add(vcRow);

       empView.applyViewCriteria(vc);

       // Multiple rows are OR-ed in WHERE clause.
       System.out.println("Demo View Criteria");

       // Should print employees that are MANAGER or have Sal > 2500
       QueryDemo.printViewObject(empView);
    }

    public static void printViewObject(ViewObject vo)
    {
       // Execute the query, print results to the screen.
       vo.executeQuery();

       // Print the View Object's query
       System.out.println("Query: " + vo.getQuery());

       while (vo.hasNext())
       {
          Row row = vo.next();
          String rowDataStr = "";

          // How many attributes (columns) is the View Object using?
          int numAttrs = vo.getAttributeCount();

          // Column numbers start with 0, not 1.
          for (int columnNo = 0; columnNo < numAttrs; columnNo++)
          {
             // See also Row.getAttribute(String name).
             Object attrData = row.getAttribute(columnNo);
             rowDataStr += (attrData + "\t");
          }
          System.out.println(rowDataStr);
       }
    }
 

In the above code example, note that the View Object's ViewObject.applyViewCriteria(oracle.jbo.ViewCriteria) must be called to apply this ViewCriteria to the View Object.

Since:
JDeveloper 3.0
See Also:
Serialized Form

Nested Class Summary
 class ViewCriteria.NestedViewCriteriaRow
           

 

Field Summary
static java.lang.String BASE_QUERY_ALIAS_BASE
           
static int CRITERIA_MODE_CACHE
          CRITERIA_MODE_... constants are used to specify View Criteria mode.
static int CRITERIA_MODE_QUERY
          CRITERIA_MODE_... constants are used to specify View Criteria mode.
static java.lang.String FIND_MODE
           
static java.lang.String FIND_MODE_ITERATOR
           
protected  java.util.ArrayList listeners
           
protected  java.util.Hashtable mProperties
           
protected  ViewCriteria mSavedState
           
protected  VariableValueManager mVariableManager
           
static java.lang.String NESTED_QUERY_ALIAS_BASE
           
static java.lang.String NULL_VALUE
           
static java.lang.String ROOT_VC_NAME
           
static java.lang.String TEMP_VARIABLE
           

 

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData

 

Fields inherited from class java.util.AbstractList
modCount

 

Fields inherited from interface oracle.jbo.RowIterator
ITER_MODE_LAST_PAGE_FULL, ITER_MODE_LAST_PAGE_PARTIAL, SLOT_BEFORE_FIRST, SLOT_BEYOND_LAST, SLOT_DELETED, SLOT_VALID

 

Fields inherited from interface oracle.jbo.ViewCriteriaComponent
VC_CONJ_AND, VC_CONJ_NOT, VC_CONJ_OR, VC_CONJ_UNION, VC_UPPER_COL_DEFAULT, VC_UPPER_COL_FALSE, VC_UPPER_COL_TRUE

 

Constructor Summary
ViewCriteria(StructureDef structureDef)
          Creates an empty view criteria object.
ViewCriteria(ViewCriteria parent, java.lang.String structDefFullName)
          Creates a nested view criteria object
ViewCriteria(ViewObject viewObject)
          Creates an empty view criteria object.

 

Method Summary
 void activate(XMLElement node)
          For internal use only.
 void add(int index, java.lang.Object element)
           
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
 void addElement(java.lang.Object obj)
           
 void addListener(java.lang.Object target)
          For internal use only.
 void addRow(ViewCriteriaRow newRow)
          For internal use only.
static java.lang.String addTableAliasSuffix(java.lang.String origAlias, java.lang.String suffix)
          For internal use only.
 boolean clausesCacheDisabled()
           
 void clear()
           
protected  java.util.HashMap<java.lang.String,java.lang.Object> convertArrayToMap(java.lang.Object[] valuesArr)
           
protected  java.lang.Object[] convertMapToArray(java.util.HashMap<java.lang.String,java.lang.Object> varsMap)
           
 void copyFrom(ViewCriteria vc)
          For internal use only.
 Row createAndInitRow(AttributeList nvp)
          For internal use only.
 ViewCriteria createCriteria()
           
 Key createKey(AttributeList nvp)
          For internal use only.
 ViewCriteriaRow createNestedCriteriaRow(java.lang.String name, ViewCriteria criteria)
          Deprecated.  
 Row createRow()
          For internal use only.
 ViewCriteriaRow createSimpleRow(java.lang.String name)
          Deprecated.  
 ViewCriteriaRow createViewCriteriaRow()
          Creates a new ViewCriteriaRow for this ViewCriteria.
 ViewCriteriaUsage createViewCriteriaUsage()
          Creates a View Criteria reference to an existing view criteria
 void criteriaChanged()
          When a filter value changes in the view criteria it is marked dirty and the criteria manager is notified so that the view criteria is marked for a fresh clause generation in the next cycle.
 VariableValueManager ensureVariableManager()
          Returns this object's Variable Value Manager.
 java.util.Enumeration enumerateRowsInRange()
          For internal use only.
 RowIterator findByAltKey(java.lang.String keyName, Key key, int maxNumOfRows, boolean skipWhere)
          For internal use only.
 Row[] findByEntity(int eRowHandle, int maxNumOfRows)
          For internal use only.
 Row[] findByKey(Key key, int maxNumOfRows)
          For internal use only.
 RowIterator findByViewCriteria(ViewCriteria criteria, int maxNumOfRows, int queryMode)
          For internal use only.
 java.lang.Object findElementByName(java.lang.String elemName)
           
 java.lang.Object findElementWithRelativeName(java.lang.String compName)
          Find a view criteria element given a full path.
 ViewCriteriaItem findViewCriteriaItem(java.lang.String compName)
          Deprecated. use findElementWithRelativeName(String) instead
 Row first()
          For internal use only.
 boolean get1013CompatibilityMode()
          With the 10.1.3 compatibility flag set to true, SQL fragment is allowed in the value argument in calls to ViewCriteriaRow.setAttribute() method.
 java.util.Collection<Variable> getAllBindVariables()
           
protected  void getAllBindVariables(java.util.HashMap<java.lang.String,Variable> map)
          The collection of bind variables that are used in this view criteria.
 Row[] getAllRowsInRange()
          For internal use only.
 int getAttributeIndexOf(java.lang.String name)
          For internal use only.
 CriteriaClauses getClauses()
          For internal use only.
 int getConjunction()
          Conjunction of a view criteria is used when nested view criteria are converted into where clauses.
 VariableValueManager getContextualVariableManager()
          For internal use only.
 java.lang.String getCriteriaAlias(ViewCriteria vc)
          For internal use only.
 int getCriteriaMode()
          Gets the current View Criteria mode.
 Row getCurrentRow()
          For internal use only.
 int getCurrentRowIndex()
          For internal use only.
 int getCurrentRowSlot()
          For internal use only.
 java.lang.String getDisplayName(LocaleContext locale)
          Deprecated. Use getProperty(String, LocaleContext) instead. For the property name argument pass ViewCriteriaHints.CRITERIA_DISPLAY_NAME.
protected  java.util.Hashtable getElementProperties(XMLElement propertiesNode)
          For internal use only.
 java.lang.Object getExtendedDataForVarName(java.lang.String varName)
          For internal use only.
 int getExtendedDataOffset()
          For internal use only.
 int getFetchedRowCount()
          For internal use only.
 int getIterMode()
          For internal use only Gets the iteration mode.
protected  java.util.ArrayList getListenersList()
          For internal use only.
 java.util.Hashtable getLocalAndResourceProperties()
          For internal use only.
 java.lang.String getLocaleName(LocaleContext locale, java.lang.String sName)
          For internal use only.
 java.lang.Class getMessageBundleClass()
           
 java.lang.String getName()
          Returns the name of this Variable Manager Owner.
 java.util.HashMap<java.lang.String,ViewCriteria> getNestedViewCriteria(java.util.HashMap<java.lang.String,ViewCriteria> criteriaMap)
          For internal use only.
 ViewCriteria getParentViewCriteria()
           
 java.util.Hashtable getProperties()
          Gets the table of properties.
 java.util.Hashtable getProperties(LocaleContext context)
           
 java.lang.Object getProperty(java.lang.String property)
          Retrieves the specified property, if it exists.
 java.lang.Object getProperty(java.lang.String property, LocaleContext locale)
           
 int getRangeIndexOf(Row row)
          For internal use only.
 int getRangeSize()
          For internal use only.
 int getRangeStart()
          For internal use only.
 ResourceBundleDef getResourceBundleDef()
           
protected  void getResourcesFromBundle(LocaleContext locale, java.util.HashMap map)
          Get all resources from the resource bundle.
 java.lang.String getRootCriteriaRelativeName()
           
 ViewCriteria getRootViewCriteria()
           
 Row getRow(Key key)
          For internal use only.
 Row getRowAtRangeIndex(int index)
          For internal use only.
 int getRowCount()
          For internal use only.
 int getRowCountInRange()
          For internal use only.
 java.util.List getRows()
          For internal use only.
 java.util.HashMap<java.lang.String,java.lang.Object> getSavedVariables()
          For internal use only.
 StructureDef getStructureDef()
           
 java.lang.String getStructureDefFullName()
           
 int getUpperColumnsValue()
          For internal use only.
 java.lang.String[] getUsedAttributeNames()
          For internal use only.
 AttributeDef[] getUsedViewAttributes()
          For internal use only.
 VariableValueManager getVariableManager()
          Returns this object's current Variable Value Manager.
 ViewCriteriaManager getViewCriteriaManager()
           
 ViewObject getViewObject()
          Gets the View Object that owns the view criteria.
 ViewObject getViewObject(boolean getVoIfNested)
          For internal use only.
protected  VariableManager getVoVariableManager()
          For internal use only.
 boolean hasData()
          For internal use only.
 boolean hasNext()
          For internal use only.
 boolean hasPrevious()
          For internal use only.
 boolean hasVariables()
          For internal use only.
 void initName(java.lang.String name)
          For internal use only.
 void insertElementAt(java.lang.Object obj, int index)
           
 void insertRow(Row row)
          For internal use only.
 void insertRowAtRangeIndex(int index, Row row)
          For internal use only.
 boolean isAppliedIfJoinSatisfied()
          For internal use only.
 boolean isCriteriaForQuery()
          Returns a flag indicating whether the View Criteria is to be included in database query.
 boolean isCriteriaForRowMatch()
          Returns a flag indicating whether the View Criteria is to be used for in-memory row filtering.
 boolean isDirty()
           
 boolean isItemHolder()
          For internal use only.
 boolean isRangeAtBottom()
          For internal use only.
 boolean isRangeAtTop()
          For internal use only.
 boolean isRowValidation()
          For internal use only.
 boolean isSubQueryAliasEnabled()
          For internal use only.
static boolean isTemporaryVariable(Variable var)
          For internal use only.
 boolean isTemporaryVariableBelongs(Variable var)
          For internal use only.
 boolean isUpperColumns()
          Upper column setting on a view criteria controls the default behavior of matching with case for all string type filter values used in the criteria items.
 boolean isUseAttributeFormatHint()
          Deprecated.  
 boolean isUseBindVarsOnly()
          When a view criteria is set to bind vars only mode, the literal values are converted into temporary bind variables so that database and jdbc layers can use statement caching even when the literal values change.
 Row last()
          For internal use only.
 void loadVOBindVariables(java.util.HashMap<java.lang.String,Variable> bindVarMap)
          For internal use only.
 void mergeFrom(ViewCriteria vc)
          For internal use only.
 Row next()
          For internal use only.
 void passivate(XMLDocument doc, XMLElement node)
          For internal use only.
protected  void passivateElementProperties(XMLDocument doc, XMLElement parentNode, java.util.Hashtable props)
          For internal use only.
 Row previous()
          For internal use only.
 void putCriteriaAlias(ViewCriteria vc, java.lang.String vcAlias)
          For internal use only.
 java.lang.String putDefaultCriteriaAlias(ViewCriteria vc, boolean isNested)
          For internal use only.
 java.lang.Object refreshProperty(java.lang.String hintName)
          For internal use only.
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
 void removeAllElements()
           
 void removeCurrentRow()
          For internal use only.
 Row removeCurrentRowAndRetain()
          For internal use only.
 void removeCurrentRowFromCollection()
          For internal use only.
 boolean removeElement(java.lang.Object obj)
           
 void removeElementAt(int index)
           
 void removeListener(java.lang.Object target)
          For internal use only.
 void removeProperty(java.lang.String hintName)
          Remove a property from the hash table maintained in the view criteria.
protected  void removeRange(int fromIndex, int toIndex)
           
 boolean removeRow(ViewCriteriaRow row)
          For internal use only.
 void reset()
          For internal use only.
 void resetCriteria()
          Restore the View Criteria to the latest saved state.
 void resolve(ViewCriteriaResolver resolver)
          For internal use only.
 boolean retainAll(java.util.Collection c)
           
 void saveState()
          Save the current state of the View Criteria which will be used to restore when resetCriteria is called.
 int scrollRange(int amount)
          For internal use only.
 int scrollRangeTo(Row row, int index)
          For internal use only.
 int scrollToRangePage(int pageIndex)
          For internal use only.
 java.lang.Object set(int index, java.lang.Object element)
           
 void set1013CompatibilityMode(boolean mode)
          With the 10.1.3 compatibility flag set to true, SQL fragment is allowed in the value argument in calls to ViewCriteriaRow.setAttribute() method.
 void setAppliedIfJoinSatisfied(boolean bApplied)
          For internal use only.
 void setClauses(CriteriaClauses clauses)
          For internal use only.
 void setConjunction(int conj)
          Conjunction of a view criteria is used when nested view criteria are converted into where clauses.
 void setConjunctionOnChildren(int conjunction)
          For internal use only.
 void setCriteriaForQuery(boolean b)
          Deprecated. Since JDeveloper 10.1.3. Use setCriteriaMode(int) instead
 void setCriteriaMode(int mode)
          Sets the criteria mode which controls the manner in which the View Criteria will be used.
 boolean setCurrentRow(Row row)
          For internal use only.
 boolean setCurrentRowAtRangeIndex(int index)
          For internal use only.
 void setDirty(boolean isDirty)
          For internal use only.
 void setElementAt(java.lang.Object obj, int index)
           
 void setExtendedDataForVarName(java.lang.String varName, java.lang.Object extendedData)
          For internal use only.
 void setExtendedDataOffset(int offset, boolean bSkipIfAlreadySet)
          For internal use only.
 void setIterMode(int mode)
          For internal use only.
 void setKeepExtendedDataOffset(boolean keepExtendedDataOffset)
          For internal use only.
 void setName(java.lang.String name)
          Assign a name to the View Criteria instance.
 void setParent(java.lang.Object parent)
          Change the owner of the view criteria.
 void setProperties(java.util.Hashtable properties)
          Override all the properties currently defined on this view criteria.
 void setProperty(java.lang.String hintName, java.lang.Object hintValue)
          Set a property on view criteria.
 int setRangeSize(int size)
          For internal use only.
 int setRangeStart(int start)
          For internal use only.
 void setRowValidation(boolean flag)
          For internal use only.
 void setSavedValuesInVariableMgr()
          For internal use only.
 void setSavedVariables(java.util.HashMap<java.lang.String,java.lang.Object> savedVariablesMap)
          For internal use only.
 void setStructureDefFullName(java.lang.String defName)
          For internal use only.
 void setSubQueryAliasEnabled(boolean bEnabled)
          For internal use only.
 void setUpperColumns(boolean b)
          Upper column setting on a view criteria controls the default behavior of matching with case for all string type filter values used in the criteria items.
 void setUseAttributeFormatHint(boolean flag)
          Deprecated.  
 void setUseBindVarsForLiterals(boolean useBindVarsOnly)
          Enables or Disables the usage of bind variables for literal values in view criteria.
 void setVariableManager(VariableValueManager variableManager)
          For internal use only.
 void setViewCriteriaManager(ViewCriteriaManager manager)
          For internal use only.
 void setViewObject(ViewObject vo)
          For internal use only.
 java.lang.String toString()
           
 void trimNoDataRows()
          For internal use only.
 void useBindVarsOnly()
          When a view criteria is set to bind vars only mode, the literal values are converted into temporary bind variables so that database and jdbc layers can use statement caching even when the literal values change.
 void validate()
          Performs view criteria item required and selectively required validation
 void validate(java.util.HashMap whereParams)
          Performs view criteria item required and selectively required validation.

 

Methods inherited from class java.util.Vector
capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, setSize, size, subList, toArray, toArray, trimToSize

 

Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator

 

Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface java.util.List
iterator, listIterator, listIterator

 

Field Detail

mProperties

protected transient java.util.Hashtable mProperties

mSavedState

protected transient ViewCriteria mSavedState

mVariableManager

protected transient VariableValueManager mVariableManager

CRITERIA_MODE_QUERY

public static int CRITERIA_MODE_QUERY
CRITERIA_MODE_... constants are used to specify View Criteria mode. CRITERIA_MODE_QUERY means that the View Criteria will be used to augment the database query's where-clause.

These constants may be OR'ed together. For example, (CRITERIA_MODE_QUERY | CRITERIA_MODE_CACHE) specifies that the View Criteria will be used for the database query, as well as the RowMatch (in-memory row filtering).


CRITERIA_MODE_CACHE

public static int CRITERIA_MODE_CACHE
CRITERIA_MODE_... constants are used to specify View Criteria mode. CRITERIA_MODE_CACHE means that the View Criteria will be used to produce a RowMatch, which is used for in-memory row filtering.

These constants may be OR'ed together. For example, (CRITERIA_MODE_QUERY | CRITERIA_MODE_CACHE) specifies that the View Criteria will be used for the database query, as well as the RowMatch (in-memory row filtering).


TEMP_VARIABLE

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

ROOT_VC_NAME

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

FIND_MODE

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

FIND_MODE_ITERATOR

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

NULL_VALUE

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

BASE_QUERY_ALIAS_BASE

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

NESTED_QUERY_ALIAS_BASE

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

listeners

protected java.util.ArrayList listeners

Constructor Detail

ViewCriteria

public ViewCriteria(ViewObject viewObject)
Creates an empty view criteria object.
Parameters:
viewObject - the owner of this ViewCriteria.

ViewCriteria

public ViewCriteria(StructureDef structureDef)
Creates an empty view criteria object.
Parameters:
structureDef - the owner of this ViewCriteria.

ViewCriteria

public ViewCriteria(ViewCriteria parent,
                    java.lang.String structDefFullName)
Creates a nested view criteria object
Parameters:
parent - a reference to outer view criteria owner
structDefFullName - the structure defintion determines the searchable attributes in this view criteria. This could be different from the outer view criteria in the case of accessors.

Method Detail

getName

public java.lang.String getName()
Description copied from interface: VariableManagerOwner
Returns the name of this Variable Manager Owner.
Specified by:
getName in interface VariableManagerOwner
Returns:
the name of the view criteria. The name must be unique in a given structure defintion like a view object or a view definition

initName

public void initName(java.lang.String name)
For internal use only. Used while copying and serialization, deserialization routines

setName

public void setName(java.lang.String name)
Assign a name to the View Criteria instance. The name must be unique in a given structure defintion like a view object or a view definition.
Parameters:
name - name of the view criteria

setParent

public void setParent(java.lang.Object parent)
Change the owner of the view criteria. Typically used to make a view criteria a nested view criteria under a different view criteria.
Parameters:
parent - owner of the view criteria

hasData

public final boolean hasData()
For internal use only. Used by query generation engine to quickly scan the view criteria for any clause generation.
Returns:
true if the view criteria has any data that would generate a where clause fragment, false otherwise.

setViewCriteriaManager

public void setViewCriteriaManager(ViewCriteriaManager manager)
For internal use only. The structure def that owns the view criteria instances manages the view criteria using a manager to track which ones are applied and other state of the view criteria. When a filter value is set in one of the components of this view criteria, it notifies the manager about a change in its state so that the clauses are rebuilt.
Parameters:
manager - a ViewCriteriaManager instance

getViewCriteriaManager

public ViewCriteriaManager getViewCriteriaManager()

getClauses

public CriteriaClauses getClauses()
For internal use only. When a view criteria is applied and the view object is executed, the where clause is generated for the view criteria and cached. The cached clauses are discarded when a filter value changes.
Returns:
cached criteria clauses for memory mode and query mode.

setClauses

public void setClauses(CriteriaClauses clauses)
For internal use only. When a view criteria is applied and the view object is executed, the where clause is generated for the view criteria and cached. The cached clauses are discarded when a filter value changes.

criteriaChanged

public void criteriaChanged()
When a filter value changes in the view criteria it is marked dirty and the criteria manager is notified so that the view criteria is marked for a fresh clause generation in the next cycle.

isDirty

public boolean isDirty()
Returns:
true if any structural changes are made to the view criteria. It could be addition or removal of new view criteria items, rows. It could be also be changes to the filter values held in view criteria items. This method is also used to determine if this instance has transformed since it was read from an XML defintion. If this method returns true then it is passivated when the view object is triggered for passivation for high availability scenarios.

setDirty

public void setDirty(boolean isDirty)
For internal use only. Marks the view criteria dirty for any structural changes and filter value changes
Parameters:
isDirty - true if the view criteria has changed since it was read from an XML definition. A view criteria that is created in-memory is considered always dirty.

isCriteriaForQuery

public boolean isCriteriaForQuery()
Returns a flag indicating whether the View Criteria is to be included in database query.

If true, when the View Criteria is translated into a row qualification clause, it will use the name of the database column to which the attribute is mapped.

Returns:
the flag indicating whether the View Criteria is for database query (true)

isCriteriaForRowMatch

public boolean isCriteriaForRowMatch()
Returns a flag indicating whether the View Criteria is to be used for in-memory row filtering.

If the View Criteria is being used for in memory row filtering, it should be used in conjunction with RowQualifier. See ViewObjectImpl.setRowQualifier(oracle.jbo.server.RowQualifier) for details.

Returns:
the flag indicating whether the View Criteria is for in-memory row filtering

setCriteriaForQuery

public void setCriteriaForQuery(boolean b)
Deprecated. Since JDeveloper 10.1.3. Use setCriteriaMode(int) instead
Sets the flag indicating whether the View Criteria is to be included in database query or be used for in memory row filtering.

If true, when the View Criteria is translated into a row qualification clause, it will use the name of the database column to which the attribute is mapped. If false, the attribute name is used as is.

If the View Criteria is being used for in memory row filtering, it should be used in conjunction with RowQualifier. See ViewObjectImpl.setRowQualifier(oracle.jbo.server.RowQualifier) for details.

Parameters:
b - the flag indicating whether the View Criteria is for database query (true) or for in memory row filtering (false).

getCriteriaMode

public int getCriteriaMode()
Gets the current View Criteria mode.

See CRITERIA_MODE_QUERY and CRITERIA_MODE_CACHE for a description of supported modes.

The returning mode may be a combination (through bit-wise OR) multiple criteria modes.

Returns:
the current View Criteria mode.

setCriteriaMode

public void setCriteriaMode(int mode)
Sets the criteria mode which controls the manner in which the View Criteria will be used.

See CRITERIA_MODE_QUERY and CRITERIA_MODE_CACHE for a description of supported modes.

The criteria mode constants may be OR'ed together. For example, if this method is called with (CRITERIA_MODE_QUERY | CRITERIA_MODE_CACHE), the View Criteria will be used for the database query, as well as the RowMatch (in-memory row filtering).

Parameters:
mode - the new criteria mode.

setAppliedIfJoinSatisfied

public void setAppliedIfJoinSatisfied(boolean bApplied)
For internal use only. This view criteria is a special view criteria applied on declarative view objects created for accessors.
Parameters:
bApplied - flag to indicate if the view criteria needs to be applied when join is activated

isAppliedIfJoinSatisfied

public boolean isAppliedIfJoinSatisfied()
For internal use only. This view criteria is a special view criteria applied on declarative view objects created for accessors.
Returns:
true if the view criteria needs to be applied when join is activated

setViewObject

public void setViewObject(ViewObject vo)
For internal use only. Assigns a structure defintion to the view criteria instance.
Parameters:
vo - the owner of the view criteria

resolve

public void resolve(ViewCriteriaResolver resolver)
For internal use only. After reading a view criteria instance from XML the view criteria needs to find the owner by evaluating the structure def name.
Parameters:
resolver - used to locate the structure def

getStructureDef

public StructureDef getStructureDef()
Returns:
structure definition that this criteria is based on.

getStructureDefFullName

public java.lang.String getStructureDefFullName()
Returns:
the fully qualified name of the structure definition this criteria is based on

setStructureDefFullName

public void setStructureDefFullName(java.lang.String defName)
For internal use only.
Parameters:
defName - the fully qualified name of the structure definition this criteria is based on

getViewObject

public ViewObject getViewObject()
Gets the View Object that owns the view criteria.
Returns:
the ViewObject that owns this ViewCriteria.

getViewObject

public ViewObject getViewObject(boolean getVoIfNested)
For internal use only. This method returns the View Object that owns this view criteria. If the getVoIfNested argument is true, and if this view criteria is a view criteria for a compound VC item, this method will return the View Object of the view criteria that contains this nested VC or compound VC item.
Parameters:
getVoIfNested - true if the VO of the owning VC should be retrieved if this VC is a nested VC or an item holder for a VC item. If false, this method returns the owning view object, which could be null for nested VC or item holder.
Returns:
The View Object that owns the view criteria, or that owns the view criteria that owns this nested view criteria or item holder.

getParentViewCriteria

public ViewCriteria getParentViewCriteria()
Returns:
If this view criteria is a nested view criteria then this method returns a reference to its parent, otherwise a null value is returned.

getRootViewCriteria

public ViewCriteria getRootViewCriteria()
Returns:
If this view criteria is nested deep in a view criteria structure this method walks all the way to the top most container view criteria and returns its reference, otherwise simply returns a refernce to itself. This method never returns null.

getRootCriteriaRelativeName

public java.lang.String getRootCriteriaRelativeName()
Returns:
a '.' separated fully qualified name relative to the root. If this view criteria is itself the root then this method returns the name of the view criteria.

findViewCriteriaItem

public ViewCriteriaItem findViewCriteriaItem(java.lang.String compName)
Deprecated. use findElementWithRelativeName(String) instead
Locates a view criteria item within the structure of a view criteria.
Parameters:
compName - The fully qualified name of the view criteria item
Returns:
an instance to ViewCriteriaItem if found, null otherwise.

findElementWithRelativeName

public java.lang.Object findElementWithRelativeName(java.lang.String compName)
Find a view criteria element given a full path. The path should be a . separated list of view criteria elements from the root criteria. Use getRootCriteriaRelativeName() to obtain the path and use it later to find the element
Parameters:
compName - The full path to the element relative to the root view criteria
Returns:
a View Criteria element, could be a nested view criteria, view criteria row, or an item.

isItemHolder

public boolean isItemHolder()
For internal use only. Find out if this ViewCriteria is an item holder for a compound view criteria item.
Returns:
true if this view criteria is an item holder for a compound view criteria item, false otherwise.

getAttributeIndexOf

public int getAttributeIndexOf(java.lang.String name)
For internal use only. Finds the attribute associated with an attribute name.
Parameters:
name - the attribute name.
Returns:
an attribute index (0 based).

getUsedAttributeNames

public java.lang.String[] getUsedAttributeNames()
For internal use only. Finds all the attribute names recursively used in this view criteria.
Returns:
an array of attribute names

getUsedViewAttributes

public AttributeDef[] getUsedViewAttributes()
For internal use only. Finds all the attribute definitions used in this view criteria. Assumes that resolve() has been called or the structure definition has been set.

createViewCriteriaRow

public ViewCriteriaRow createViewCriteriaRow()
Creates a new ViewCriteriaRow for this ViewCriteria. A ViewCriteriaRow object is an array for WHERE clause criteria. After setting up the ViewCriteriaRow, call add(viewCriteriaRow) or addElement(viewCriteriaRow) to add it to this ViewCriteria.
Returns:
a ViewCriteriaRow, an array for WHERE clause criteria.
See Also:
ViewCriteriaRow

createViewCriteriaUsage

public ViewCriteriaUsage createViewCriteriaUsage()
Creates a View Criteria reference to an existing view criteria
Returns:
a ViewCriteriaUsaga instance that contains the the information needed to resolve the view criteria
See Also:
ViewCriteriaUsage

getConjunction

public int getConjunction()
Conjunction of a view criteria is used when nested view criteria are converted into where clauses. A nested view criteria can be AND'ed or OR'ed with another nested view criteria or view criteria row. Conjunction on a root view criteria is never used.
Specified by:
getConjunction in interface ViewCriteriaComponent
Returns:
the conjunction of a view criteria

setConjunction

public void setConjunction(int conj)
Conjunction of a view criteria is used when nested view criteria are converted into where clauses. A nested view criteria can be AND'ed or OR'ed with another nested view criteria or view criteria row. Conjunction on a root view criteria is never used.
Specified by:
setConjunction in interface ViewCriteriaComponent
Parameters:
conj -

isUpperColumns

public boolean isUpperColumns()
Upper column setting on a view criteria controls the default behavior of matching with case for all string type filter values used in the criteria items. Individual view criteria items may override this behavior.
Specified by:
isUpperColumns in interface ViewCriteriaComponent
Returns:
if all filter values need to matched ignoring the case

setUpperColumns

public void setUpperColumns(boolean b)
Upper column setting on a view criteria controls the default behavior of matching with case for all string type filter values used in the criteria items. Individual view criteria items may override this behavior.
Specified by:
setUpperColumns in interface ViewCriteriaComponent
Parameters:
b - set the ignore case property of this view criteria

getUpperColumnsValue

public int getUpperColumnsValue()
For internal use only.
Specified by:
getUpperColumnsValue in interface ViewCriteriaComponent
Returns:
the value of the internal state of ignore case property

useBindVarsOnly

public void useBindVarsOnly()
When a view criteria is set to bind vars only mode, the literal values are converted into temporary bind variables so that database and jdbc layers can use statement caching even when the literal values change.

setUseBindVarsForLiterals

public void setUseBindVarsForLiterals(boolean useBindVarsOnly)
Enables or Disables the usage of bind variables for literal values in view criteria. By default they are enabled to prevent sql injection and promote statement caching.
Parameters:
useBindVarsOnly - if true enables bind variable usage, disables otherwise

isUseBindVarsOnly

public boolean isUseBindVarsOnly()
When a view criteria is set to bind vars only mode, the literal values are converted into temporary bind variables so that database and jdbc layers can use statement caching even when the literal values change.
Returns:
true if the view criteria is set to bind vars only mode

set1013CompatibilityMode

public void set1013CompatibilityMode(boolean mode)
With the 10.1.3 compatibility flag set to true, SQL fragment is allowed in the value argument in calls to ViewCriteriaRow.setAttribute() method. This flag is false by default. Allowing SQL fragment in the value argument of setAttribute should be done only if the risk of SQL injection has been carefully considered.
Parameters:
mode - true to allow SQL fragment in value argument of ViewCriteriaRow.setAttribute(), false to unset.

get1013CompatibilityMode

public boolean get1013CompatibilityMode()
With the 10.1.3 compatibility flag set to true, SQL fragment is allowed in the value argument in calls to ViewCriteriaRow.setAttribute() method. This flag is false by default. Allowing SQL fragment in the value argument of setAttribute should be done only if the risk of SQL injection has been carefully considered.
Returns:
true if the view criteria should allow 10.1.3 style of usage

loadVOBindVariables

public void loadVOBindVariables(java.util.HashMap<java.lang.String,Variable> bindVarMap)
For internal use only. This method fetches the required (or where kind) bind variables from the owning view object
Parameters:
bindVarMap - the hashmap that will contain bind variable name and reference to the required bind variables

getAllBindVariables

public java.util.Collection<Variable> getAllBindVariables()
Returns:
The collection of bind variables that are used in this view criteria. The list also includes the required bind variables defined on the owning view object.

getAllBindVariables

protected void getAllBindVariables(java.util.HashMap<java.lang.String,Variable> map)
The collection of bind variables that are used in this view criteria.
Parameters:
map - the hashmap that will contain bind variable name and reference to the bind variables

next

public Row next()
For internal use only. Steps forward, designating the next row as the current row.
Specified by:
next in interface RowIterator
Returns:
a Row object, or null if there is no next row.

previous

public Row previous()
For internal use only. Steps backward, designating the previous row as the current row.
Specified by:
previous in interface RowIterator
Returns:
a Row object, or null if there is no previous row.

first

public Row first()
For internal use only. Designates the first row of the row set as the current row.
Specified by:
first in interface RowIterator
Returns:
a Row object, or null if the row set is empty.

last

public Row last()
For internal use only. Designates the last row of the row set as the current row.
Specified by:
last in interface RowIterator
Returns:
a Row object, or null if the row set is empty.

reset

public void reset()
For internal use only. Clears the "current row" designation and places the iterator in the slot before the first row.

A subsequent invocation of next() will cause the first row to become the current row.

Specified by:
reset in interface RowIterator

hasNext

public boolean hasNext()
For internal use only. Tests for the existence of a row after the current row.
Specified by:
hasNext in interface RowIterator
Returns:
true if there is next row.

hasPrevious

public boolean hasPrevious()
For internal use only. Tests for the existence of a row before the current row.
Specified by:
hasPrevious in interface RowIterator
Returns:
true if there is previous row.

getFetchedRowCount

public int getFetchedRowCount()
For internal use only. Counts the number of rows currently fetched in the row set.
Specified by:
getFetchedRowCount in interface RowIterator
Returns:
the number of fetched rows.

getRowCount

public int getRowCount()
For internal use only. Counts the total number of rows in the row set.
Specified by:
getRowCount in interface RowIterator
Returns:
the number of rows.

getRowAtRangeIndex

public Row getRowAtRangeIndex(int index)
For internal use only. Accesses a row through its index in the row set.
Specified by:
getRowAtRangeIndex in interface RowIterator
Parameters:
index - an integer in the range 0 to getRangeSize() - 1.
Returns:
a Row object, or null if the index is out of range.

getCurrentRow

public Row getCurrentRow()
For internal use only. Accesses the current row.
Specified by:
getCurrentRow in interface RowIterator
Returns:
the Row object designated as the current row.

getCurrentRowIndex

public int getCurrentRowIndex()
For internal use only. Gets the absolute index (not range index) of the current row.
Specified by:
getCurrentRowIndex in interface RowIterator
Returns:
a row index (0 based).

getCurrentRowSlot

public int getCurrentRowSlot()
For internal use only. Gets the slot status of the current row.
Specified by:
getCurrentRowSlot in interface RowIterator
Returns:
one of the class constants prefixed by SLOT_. See SLOT_ constants in RowIterator.

setCurrentRow

public boolean setCurrentRow(Row row)
For internal use only. Designates a given row as the current row.
Specified by:
setCurrentRow in interface RowIterator
Parameters:
row - the new current row.
Returns:
true if the operation succeeded.

createAndInitRow

public Row createAndInitRow(AttributeList nvp)
For internal use only. Use createViewCriteriaRow() API. Creates a new Row object, but does not insert it into the row set. For ViewCriteria, this method works just like createRow().
Specified by:
createAndInitRow in interface RowIterator
Parameters:
nvp - not used.
Returns:
a new Row object.

createRow

public Row createRow()
For internal use only. Use createViewCriteriaRow() API. Creates a new Row object, but does not insert it into the row set.
Specified by:
createRow in interface RowIterator
Returns:
a new Row object.

insertRow

public void insertRow(Row row)
For internal use only. Use add(Object) API. Adds a row to the row set, before the current row. This method sets the current row to the row just inserted. With respect to eventing, this method call will generate two events (of oracle.jbo.RowSetListener): rowInserted, followed by navigated.
Specified by:
insertRow in interface RowIterator
Parameters:
row - the Row object to be added.

removeCurrentRow

public void removeCurrentRow()
For internal use only. Use removeElementAt(int) API. Removes the current Row object from the row set.
Specified by:
removeCurrentRow in interface RowIterator

removeCurrentRowFromCollection

public void removeCurrentRowFromCollection()
For internal use only. Use removeElementAt(int) API. Removes the current Row object from the row set.
Specified by:
removeCurrentRowFromCollection in interface RowIterator

removeCurrentRowAndRetain

public Row removeCurrentRowAndRetain()
For internal use only. Use removeElementAt(int) API. Removes the current Row object from the row set.
Specified by:
removeCurrentRowAndRetain in interface RowIterator
Returns:
the row object that was removed

setRangeSize

public int setRangeSize(int size)
For internal use only. Modifies the size of the row set range.

This method is a no-op for ViewCriteria. For a ViweCriteria, the range size is always -1.

Specified by:
setRangeSize in interface RowIterator
Parameters:
size - this parameter is not used.
Returns:
-1, which means that the range contains all rows.
See Also:
RowIterator.setRangeStart(int)

getRangeSize

public int getRangeSize()
For internal use only. Gets the range size. For ViewCriteria, the range size is always -1 (all rows).
Specified by:
getRangeSize in interface RowIterator
Returns:
-1, which means that the range contains all rows.

getRangeStart

public int getRangeStart()
For internal use only. Gets the absolute index of the first row in the row set range.

The absolute index is 0-based, and is the row's index relative to the entire result set.

Specified by:
getRangeStart in interface RowIterator
Returns:
an index.

setRangeStart

public int setRangeStart(int start)
For internal use only. Moves the row set range.

Note that the index is 0-based. When you call setRangeStart(1), the range start will be positioned at the second table row.

Another behavior of setRangeStart (and also setRangeSize) is that it tries to position the range, so as to fill up the range as much as possible. For example, assume you have View Object vo focused on a table with four rows (A, B, C, D), and you execute the following code:

     vo.setRangeStart(4);
     vo.setRangeSize(3);
     Row[] rows = vo.getAllRowsInRange();
 

In this case, rows contains the last 3 rows (B, C, D). When you call setRangeStart(4), it will try to position you at row 4. Since the index is 0-based, it finds that there is no row. Since the default range size is 1, it will position you to the last row (row index 3).

Then, when you call getRangeSize(3), it tries to fill up the range from the bottom. This is why you get (B, C, D).

Specified by:
setRangeStart in interface RowIterator
Parameters:
start - the absolute index of the new first row in the row set range.

scrollRange

public int scrollRange(int amount)
For internal use only. Moves the row set range up or down a given number of rows.
Specified by:
scrollRange in interface RowIterator
Parameters:
amount - the number of rows to scroll. A negative value scrolls upward.
Returns:
the number of rows actually scrolled.

scrollToRangePage

public int scrollToRangePage(int pageIndex)
For internal use only. This method is a no-op and returns zero.

scrollRangeTo

public int scrollRangeTo(Row row,
                         int index)
For internal use only. Scrolls the range to place a given row at a given row set index.
Specified by:
scrollRangeTo in interface RowIterator
Parameters:
row - the row.
index - the row's new index.
Returns:
the actual number of rows scrolled. A negative number indicates that the scroll was scrolled upward.

setCurrentRowAtRangeIndex

public boolean setCurrentRowAtRangeIndex(int index)
For internal use only. Designates a given index as the current row.
Specified by:
setCurrentRowAtRangeIndex in interface RowIterator
Parameters:
index - the index of the new current row.
Returns:
true if the operation succeeded.

insertRowAtRangeIndex

public void insertRowAtRangeIndex(int index,
                                  Row row)
For internal use only. Use insertElementAt(Object, int) API. Adds a row to the row set at the given index. The index is relative to the range, i.e., index of 0 would mean to insert before the first row of the range. Allowed values for index is 0 to range size. If index equals range size, the row is inserted right after the last row in the range. This method call does not alter the current position of the iterator, nor does it affect the range position.
Specified by:
insertRowAtRangeIndex in interface RowIterator
Parameters:
index - the point where row is to be added.
row - the Row object to be added.

getRangeIndexOf

public int getRangeIndexOf(Row row)
For internal use only. Get the index of the given row relative to the beginning of the range.
Specified by:
getRangeIndexOf in interface RowIterator
Parameters:
row - a Row object. or -1 if the row is not in range.
Returns:
the range index of row (0 based).

getRowCountInRange

public int getRowCountInRange()
For internal use only. Gets the size of the row set range.
Specified by:
getRowCountInRange in interface RowIterator
Returns:
the number of rows in the range.

isRangeAtBottom

public boolean isRangeAtBottom()
For internal use only. Tests if the row set range is at the end of the result set.
Specified by:
isRangeAtBottom in interface RowIterator
Returns:
true if the last row of the range is the last row of the result set.

isRangeAtTop

public boolean isRangeAtTop()
For internal use only. Tests if the row set range is at the beginning of the result set.
Specified by:
isRangeAtTop in interface RowIterator
Returns:
true if the first row of the range is the first row of the result set.

enumerateRowsInRange

public java.util.Enumeration enumerateRowsInRange()
For internal use only. Gets an Enumeration interface for the row set.
Specified by:
enumerateRowsInRange in interface RowIterator
Returns:
an Enumeration interface.

getAllRowsInRange

public Row[] getAllRowsInRange()
For internal use only. Returns an array ViewCriteriaRow's in this ViewCriteria.
Specified by:
getAllRowsInRange in interface RowIterator
Returns:
an array of ViewCriteriaRow's.

getRow

public Row getRow(Key key)
For internal use only. Accesses a row through a unique key.

This operation is not supported by ViewCriteria. Calling this method will throw InvalidOperException.

Specified by:
getRow in interface RowIterator
Parameters:
key - a key.
Returns:
none.
Throws:
InvalidOperException - is thrown. ViewCriteria does not support this operation.

findByKey

public Row[] findByKey(Key key,
                       int maxNumOfRows)
For internal use only. Finds and returns View rows that match the specified key.

This operation is not supported by ViewCriteria. Calling this method will throw InvalidOperException.

Specified by:
findByKey in interface RowIterator
Parameters:
key - the key to match.
maxNumOfRows - the maximum size of the array to return, or -1 to return all rows.
Returns:
none.
Throws:
InvalidOperException - is thrown. ViewCriteria does not support this operation.

findByAltKey

public RowIterator findByAltKey(java.lang.String keyName,
                                Key key,
                                int maxNumOfRows,
                                boolean skipWhere)
For internal use only. Finds and returns rows that match the specified key.

This operation is not supported by ViewCriteria. Calling this method will throw InvalidOperException.

Specified by:
findByAltKey in interface RowIterator
Parameters:
key - the key to match.
maxNumOfRows - the maximum size of the array to return, or -1 to return all rows.
skipWhere - A flag that controls whether, when a db query is issued to get the matching row(s), the view object's current where-clause is to be included in the query or not.
keyName - the name of the alternate key. If null the primary key is specified, i.e., this function call becomes equivalent to findByKey with skipWhere = false.
Returns:
none.
Throws:
InvalidOperException - is thrown. ViewCriteria does not support this operation.

findByViewCriteria

public RowIterator findByViewCriteria(ViewCriteria criteria,
                                      int maxNumOfRows,
                                      int queryMode)
For internal use only. Finds and returns View rows that match the specified View Criteria. This operation is not supported by ViewCriteria. Calling this method will throw InvalidOperException.
Specified by:
findByViewCriteria in interface RowIterator
Parameters:
criteria - the View Criteria to be used to qualify View rows.
maxNumOfRows - the maximum size of the array to return, or -1 to return all rows. If a value other than -1 is specified and if the specified number of rows is reached, the method returns without performing any further operation.
queryMode - the mode in which qualify View rows are scanned. See above for further info.
Returns:
none.
Throws:
InvalidOperException - is thrown. ViewCriteria does not support this operation.

createKey

public Key createKey(AttributeList nvp)
For internal use only. Given a list of name-value pairs, creates a Key object.

This operation is not supported by ViewCriteria. Calling this method will throw InvalidOperException.

Specified by:
createKey in interface RowIterator
Parameters:
nvp - the name value pair array.
Returns:
none.
Throws:
InvalidOperException - is thrown. ViewCriteria does not support this operation.

findByEntity

public Row[] findByEntity(int eRowHandle,
                          int maxNumOfRows)
For internal use only. Finds and returns View rows that use the entity row, identified by the entity row handle, eRowHandle.

This operation is not supported by ViewCriteria. Calling this method will throw InvalidOperException.

Specified by:
findByEntity in interface RowIterator
Parameters:
eRowHandle - the entity row handle.
maxNumOfRows - the maximum size of the row array to return, or -1 to return all rows.
Returns:
none.
Throws:
InvalidOperException - is thrown. ViewCriteria does not support this operation.

setRowValidation

public void setRowValidation(boolean flag)
For internal use only. Sets the validation flag on this iterator.

This operation is not supported by ViewCriteria. Calling this method will throw InvalidOperException.

Specified by:
setRowValidation in interface RowIterator
Parameters:
flag - whether to turn row validation off or not.
Throws:
InvalidOperException - is thrown. ViewCriteria does not support this operation.

isRowValidation

public boolean isRowValidation()
For internal use only. Gets the validation flag for this iterator.
Specified by:
isRowValidation in interface RowIterator
Returns:
false

getIterMode

public int getIterMode()
For internal use only Gets the iteration mode.

As ViewCriteria always works with full range (range size -1), iteration mode is meaningless.

Specified by:
getIterMode in interface RowIterator
Returns:
the iteration mode. It is always RowIterator.ITER_MODE_LAST_PAGE_FULL.

setIterMode

public void setIterMode(int mode)
For internal use only. Modifies the iteration mode.

This method is a no-op for ViewCriteria. For a ViweCriteria, the range size is always -1, and thus iteration mode is meaningless.

Specified by:
setIterMode in interface RowIterator
Parameters:
mode - this parameter is not used.

getListenersList

protected java.util.ArrayList getListenersList()
For internal use only.
Returns:
Returns the rowset navigation listeners.

addListener

public void addListener(java.lang.Object target)
For internal use only. Adds a RowSetListener.
Specified by:
addListener in interface NavigatableRowIterator
Parameters:
target - the listener to add.

removeListener

public void removeListener(java.lang.Object target)
For internal use only. Removes a RowSetListener.
Specified by:
removeListener in interface NavigatableRowIterator
Parameters:
target - the listener to remove.

trimNoDataRows

public void trimNoDataRows()
For internal use only. This method walks through ViewCriteriaRow's in this ViewCriteria and removes those rows that have no data.

setUseAttributeFormatHint

public void setUseAttributeFormatHint(boolean flag)
Deprecated. 
Turn this flag off to get the 904 and earlier behavior where attribute formatters are not consulated for equality critiera.
Parameters:
flag - controls the 904 behavior

isUseAttributeFormatHint

public boolean isUseAttributeFormatHint()
Deprecated. 
Returns:
flag to get the 904 and earlier behavior where attribute formatters are not consulated for equality critiera.

copyFrom

public void copyFrom(ViewCriteria vc)
For internal use only. Creates a deep copy of the view criteria
Parameters:
vc - the view criteria that needs to be copied

mergeFrom

public void mergeFrom(ViewCriteria vc)
For internal use only. Merges the delta definition that are passed in to this view criteria structures. This is used to selectively override specific portions of the view criteria defintion. Typically used in applying personalizations of view criteria.
Parameters:
vc - A view criteria definition that has a specific overrides that need to be applied

findElementByName

public java.lang.Object findElementByName(java.lang.String elemName)

createCriteria

public ViewCriteria createCriteria()
Returns:
A new view criteria instance that may be added as a nested view criteria to this view criteria. add(Object) needs to be invoked to make the returned instance a nested view criteria

saveState

public void saveState()
Save the current state of the View Criteria which will be used to restore when resetCriteria is called. A snapshot of all the literal filter values and bind variable values is saved.

resetCriteria

public void resetCriteria()
Restore the View Criteria to the latest saved state. See saveState()

activate

public void activate(XMLElement node)
For internal use only. Populates the ViewCriteria with the data from the XMLElement.
Parameters:
node - The XMLElement parent node

getElementProperties

protected java.util.Hashtable getElementProperties(XMLElement propertiesNode)
For internal use only. Reads the view criteria properties from the xml
Parameters:
propertiesNode - the node that contains the properties
Returns:
a hash table that contains the properties

passivate

public void passivate(XMLDocument doc,
                      XMLElement node)
For internal use only. Creates a XML representation of the ViewCriteria and appends it to the passed in XMLElement.
Parameters:
node - the XML node that represents the owner of the view criteria

passivateElementProperties

protected void passivateElementProperties(XMLDocument doc,
                                          XMLElement parentNode,
                                          java.util.Hashtable props)
For internal use only. Convert the view criteria properties to XML
Parameters:
doc - xml document
parentNode - the properties element
props - hash table containing the view criteria properties

getRows

public java.util.List getRows()
For internal use only.
Returns:
The contents of the view criteria as rows. The nested view criteria instances are wrapped in a row interface.

addRow

public void addRow(ViewCriteriaRow newRow)
For internal use only. Use add(Object) API Adds a row to the view criteria structure. Unwraps the nested view criteria that are wrapped in a row interface before insert.
Parameters:
newRow - a new row that is added to the structure

removeRow

public boolean removeRow(ViewCriteriaRow row)
For internal use only. Use remove(Object) API Removes a row from the view criteria structure.
Parameters:
row - to be removed from the structure
Returns:
true if the passed row is found and removed from the structure

createSimpleRow

public ViewCriteriaRow createSimpleRow(java.lang.String name)
Deprecated. 
For internal use only. Creates a view criteria row instance
Parameters:
name - of the view criteria row that is returned
Returns:
a view criteria row instance

createNestedCriteriaRow

public ViewCriteriaRow createNestedCriteriaRow(java.lang.String name,
                                               ViewCriteria criteria)
Deprecated. 
For internal use only. Wrap a nested criteria into a row interface that can be returned by the navigation apis.
Parameters:
name - ignored
criteria - the nested view criteria instance
Returns:
a row that wraps the nested view criteria instance

validate

public void validate()
Performs view criteria item required and selectively required validation

validate

public void validate(java.util.HashMap whereParams)
Performs view criteria item required and selectively required validation.
Parameters:
whereParams - A Map of <bind variable name, value> if validation against bind variable values should take place. Pass in null to bypass checking for null bind variable values.

toString

public java.lang.String toString()
Overrides:
toString in class java.util.Vector
Returns:
a simple string representation of the view criteria with its name and the number of elements in its structure.

isTemporaryVariable

public static boolean isTemporaryVariable(Variable var)
For internal use only. Returns true if the variable passed is a temporary bind variable.
Parameters:
var - The variable to be checked
Returns:
true if the variable passed is a temporary variable, false otherwise.

addTableAliasSuffix

public static java.lang.String addTableAliasSuffix(java.lang.String origAlias,
                                                   java.lang.String suffix)
For internal use only. Used during query generation to store the alias of a view object to create a correlated sub-query.
Parameters:
origAlias - the original alias for the tables if they were not part of the subquery
suffix - representing how deep the table is nested in the sub-query
Returns:
a new alias for the tables used in the sub-query

isTemporaryVariableBelongs

public boolean isTemporaryVariableBelongs(Variable var)
For internal use only. Returns true if the variable passed is a temporary bind variable created for this view criteria.
Parameters:
var - The variable to be checked
Returns:
true if the variable passed is a temporary variable that is created for this view criteria, false if it is not a temporary variable or it is a temporary variable created for a different view criteria.

getNestedViewCriteria

public java.util.HashMap<java.lang.String,ViewCriteria> getNestedViewCriteria(java.util.HashMap<java.lang.String,ViewCriteria> criteriaMap)
For internal use only.
Returns:
a map of nested view criteria within this object.

hasVariables

public boolean hasVariables()
For internal use only. Use getAllBindVariables() API.
Specified by:
hasVariables in interface VariableManagerOwnerBase
Returns:
true if the view criteria's variable manager has any variables defined

getVariableManager

public VariableValueManager getVariableManager()
Description copied from interface: VariableManagerOwnerBase
Returns this object's current Variable Value Manager. It will return null if Variable Value Manager has been initialized.

When a framework object is first created, its Variable Value Manager may be null. This method does not initialize (create) the Variable Value Manager.

VariableManagerOwnerBase.ensureVariableManager() in contrast, ensures that the Variable Value Manager is initialized (created).

Specified by:
getVariableManager in interface VariableManagerOwnerBase
Returns:
the variable manager to set values for bind values used in this view criteria structure.

setVariableManager

public void setVariableManager(VariableValueManager variableManager)
For internal use only.
Parameters:
variableManager - view criteria is assigned a variable manager by the view object to set and get variable values.

ensureVariableManager

public VariableValueManager ensureVariableManager()
Description copied from interface: VariableManagerOwnerBase
Returns this object's Variable Value Manager. If this object current has no Variable Value Manager, it will initialize (create) one.
Specified by:
ensureVariableManager in interface VariableManagerOwnerBase
Returns:
the variable manager to set values for bind values used in this view criteria structure.

getMessageBundleClass

public java.lang.Class getMessageBundleClass()
Specified by:
getMessageBundleClass in interface VariableManagerOwnerBase
Returns:
the message bundle used to store locale specific properties of this view criteria

getResourceBundleDef

public ResourceBundleDef getResourceBundleDef()
Specified by:
getResourceBundleDef in interface VariableManagerOwnerBase
Returns:
the message bundle def used to store locale specific properties of this view criteria

setSavedVariables

public void setSavedVariables(java.util.HashMap<java.lang.String,java.lang.Object> savedVariablesMap)
For internal use only.
Parameters:
savedVariablesMap - stores the variable name value pairs that the user customizes for this view criteria. If the values are not changed subsequently they are pushed into the variable manager prior to query execute

getSavedVariables

public java.util.HashMap<java.lang.String,java.lang.Object> getSavedVariables()
For internal use only.
Returns:
the variable name value pairs that the user customized for this view criteria. If the values were not changed subsequently they will be pushed into the variable manager prior to query execute

setSavedValuesInVariableMgr

public void setSavedValuesInVariableMgr()
For internal use only. Any saved bind variable value that is not set on the variable manager yet need to pushed prior to the execution of the query. In the case of saved searches, the view criteria may contain its own copy of bind variable value defaults that need to be pushed into the variable manager.

add

public void add(int index,
                java.lang.Object element)
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.Vector

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.Vector

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.Vector

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.Vector

addElement

public void addElement(java.lang.Object obj)
Overrides:
addElement in class java.util.Vector

clear

public void clear()
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class java.util.Vector

insertElementAt

public void insertElementAt(java.lang.Object obj,
                            int index)
Overrides:
insertElementAt in class java.util.Vector

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.Vector

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.Vector

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List
Overrides:
removeAll in class java.util.Vector

removeAllElements

public void removeAllElements()
Overrides:
removeAllElements in class java.util.Vector

removeElement

public boolean removeElement(java.lang.Object obj)
Overrides:
removeElement in class java.util.Vector

removeElementAt

public void removeElementAt(int index)
Overrides:
removeElementAt in class java.util.Vector

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Overrides:
removeRange in class java.util.Vector

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List
Overrides:
retainAll in class java.util.Vector

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface java.util.List
Overrides:
set in class java.util.Vector

setElementAt

public void setElementAt(java.lang.Object obj,
                         int index)
Overrides:
setElementAt in class java.util.Vector

getLocaleName

public java.lang.String getLocaleName(LocaleContext locale,
                                      java.lang.String sName)
For internal use only. Gets a locale specific name for a given property
Parameters:
locale - the locale context for the current thread of execution
sName - the name of the property that needs to be resolved
Returns:
the locale specific name for the property. Usually the property is suffixed by the locale name

getResourcesFromBundle

protected void getResourcesFromBundle(LocaleContext locale,
                                      java.util.HashMap map)
Get all resources from the resource bundle. Adopted from NamedObjectImpl.getResourcesFromBundle
Parameters:
locale - locale of the resources to be retrieved.
map - the retrieved resources will be added to the map.

getProperty

public java.lang.Object getProperty(java.lang.String property,
                                    LocaleContext locale)
Specified by:
getProperty in interface Properties
Parameters:
property - the name of the property
locale - the locale context for the current thread of execution
Returns:
the property value from either the resource bundle or from a hash table

getProperty

public java.lang.Object getProperty(java.lang.String property)
Description copied from interface: Properties
Retrieves the specified property, if it exists.
Specified by:
getProperty in interface Properties
Parameters:
property - the name of the property
Returns:
the property value from either the resource bundle or from a hash table

refreshProperty

public java.lang.Object refreshProperty(java.lang.String hintName)
For internal use only.
Specified by:
refreshProperty in interface Properties
Parameters:
hintName - the property that needs to be re-resolved from the message bundle
Returns:
resolve the property again from the message bundle

getLocalAndResourceProperties

public java.util.Hashtable getLocalAndResourceProperties()
For internal use only. Used by the marshaller to get all the properties and resources (on the server side only) that are defined in this view criteria.
Returns:
A table containing the properties

getProperties

public java.util.Hashtable getProperties()
Description copied from interface: Properties
Gets the table of properties.
Specified by:
getProperties in interface Properties
Returns:
a hash table that contains the properties for this view criteria. Callers should use the getProperties(LocaleContext) because it will return a value by looking up the message bundle and for a given locale

getProperties

public java.util.Hashtable getProperties(LocaleContext context)
Parameters:
context - the locale context for the current thread of execution
Returns:
a hash table containing properties for a given locale

setProperty

public void setProperty(java.lang.String hintName,
                        java.lang.Object hintValue)
Set a property on view criteria. The properties set during runtime are not locale specific.
Parameters:
hintName - name of the property
hintValue - value of the property. If the property needs to be passivated and activated the value needs to be converted to a String by the caller.

removeProperty

public void removeProperty(java.lang.String hintName)
Remove a property from the hash table maintained in the view criteria. This method does not remove the message bundle strings defined during design time.
Parameters:
hintName - the name of the property

setProperties

public void setProperties(java.util.Hashtable properties)
Override all the properties currently defined on this view criteria.
Parameters:
properties - the view criteria will store a reference to the hash table passed in the argument and use it for all property lookups.

getDisplayName

public final java.lang.String getDisplayName(LocaleContext locale)
Deprecated. Use getProperty(String, LocaleContext) instead. For the property name argument pass ViewCriteriaHints.CRITERIA_DISPLAY_NAME.
Retrieves the label to be used in search form.
Parameters:
locale -
Returns:
display name for the given locale.

getVoVariableManager

protected VariableManager getVoVariableManager()
For internal use only.
Returns:
the variable manager of the view object that owns this view criteria.

getCriteriaAlias

public java.lang.String getCriteriaAlias(ViewCriteria vc)
For internal use only. The view criteria is used to track state during query generation phase for generating correlated subqueries.

putCriteriaAlias

public void putCriteriaAlias(ViewCriteria vc,
                             java.lang.String vcAlias)
For internal use only. The view criteria is used to track state during query generation phase for generating correlated subqueries.

putDefaultCriteriaAlias

public java.lang.String putDefaultCriteriaAlias(ViewCriteria vc,
                                                boolean isNested)
For internal use only. The view criteria is used to track state during query generation phase for generating correlated subqueries.

setSubQueryAliasEnabled

public void setSubQueryAliasEnabled(boolean bEnabled)
For internal use only. The view criteria is used to track state during query generation phase for generating correlated subqueries.

isSubQueryAliasEnabled

public boolean isSubQueryAliasEnabled()
For internal use only. The view criteria is used to track state during query generation phase for generating correlated subqueries.

convertMapToArray

protected java.lang.Object[] convertMapToArray(java.util.HashMap<java.lang.String,java.lang.Object> varsMap)

convertArrayToMap

protected java.util.HashMap<java.lang.String,java.lang.Object> convertArrayToMap(java.lang.Object[] valuesArr)

setExtendedDataForVarName

public void setExtendedDataForVarName(java.lang.String varName,
                                      java.lang.Object extendedData)
For internal use only. Used to set VC specific extended data offsets for a variable.

getExtendedDataForVarName

public java.lang.Object getExtendedDataForVarName(java.lang.String varName)
For internal use only. Used to set VC specific extended data offsets for a variable.

setExtendedDataOffset

public void setExtendedDataOffset(int offset,
                                  boolean bSkipIfAlreadySet)
For internal use only. Used to set VC specific extended data offsets.

setKeepExtendedDataOffset

public void setKeepExtendedDataOffset(boolean keepExtendedDataOffset)
For internal use only. Used to set VC specific extended data offsets.

getExtendedDataOffset

public int getExtendedDataOffset()
For internal use only. Used to get VC specific extended data offsets.

clausesCacheDisabled

public boolean clausesCacheDisabled()

setConjunctionOnChildren

public void setConjunctionOnChildren(int conjunction)
For internal use only. Convenience API for setting the conjunction of all the child objects inside this view criteria.
Parameters:
conjunction - The conjunction that the child objects should be using.

getContextualVariableManager

public VariableValueManager getContextualVariableManager()
For internal use only.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.5.0)

E10653-06


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