Skip navigation links

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

E10653-03


oracle.jbo.client.remote
Class ViewUsageImpl

java.lang.Object
  extended by oracle.jbo.common.PropertiesHelper
      extended by oracle.jbo.client.remote.ViewUsageImpl

All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, ClientComponentObject, InternalListenerManager, ViewObjectDynAttr, WSRowSetIteratorMarshaller, WSVariableValueManagerMarshaller, WSViewObjectMarshaller, ComponentObject, NavigatableRowIterator, OperationContainer, Properties, RowIterator, RowNavigationListener, RowSet, RowSetIterator, RowSetListener, StructureDef, VariableManagerOwner, VariableManagerOwnerBase, ViewCriteriaManager, ViewObject, XMLInterface

public class ViewUsageImpl
extends PropertiesHelper
implements ClientComponentObject, ViewObject, RowSetListener, InternalListenerManager, WSViewObjectMarshaller, WSRowSetIteratorMarshaller, WSVariableValueManagerMarshaller, ViewObjectDynAttr, ViewCriteriaManager, OperationContainer
See Also:
Serialized Form

Field Summary
protected  ApplicationModuleImpl mAM
           
protected  ViewCriteria mCriteria
           
protected  boolean mCriteriaGotten
           
protected  RowSet mDefaultRowSet
           
protected  java.lang.String mDefFullName
           
protected  java.lang.String mDefName
           
protected  java.lang.String mFullName
           
protected  int mId
           
protected  java.lang.String mInterfaceName
           
protected  boolean mIsInternal
           
protected  boolean mIsReadOnly
           
protected  java.lang.String mName
           
protected  java.lang.String mRowProxyClassName
           
protected  StructureDefImpl mStruct
           
protected  java.util.ArrayList mViewLinks
           

 

Fields inherited from class oracle.jbo.common.PropertiesHelper
mProperties

 

Fields inherited from interface oracle.jbo.ViewObject
IMAGE_LOC, QUERY_MODE_SCAN_DATABASE_TABLES, QUERY_MODE_SCAN_ENTITY_ROWS, QUERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS, QUERY_MODE_SCAN_VIEW_ROWS, QUERY_MODE_SKIP_WHERE, QUERY_TIMEOUT_WAIT_FOREVER, XML_ELEM_PASSIVATE_TRANSIENT

 

Fields inherited from interface oracle.jbo.RowSet
COPY_OPT_ALL_ROWS, COPY_OPT_LIMIT_RANGE, FORWARD_ONLY, RANGE_PAGING, RANGE_PAGING_AUTO_POST, RANGE_PAGING_INCR, SCROLLABLE

 

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.XMLInterface
XML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT, XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE

 

Fields inherited from interface oracle.jbo.ViewCriteriaManager
DFLT_VIEW_CRITERIA_NAME, IMPLICIT_VIEW_CRITERIA_NAME, QUICKSEARCH_VIEW_CRITERIA_NAME

 

Constructor Summary
protected ViewUsageImpl()
           

 

Method Summary
 AttributeDef addDynamicAttribute(java.lang.String attrName)
          Adds a dynamic attribute (an AttributeDefImpl) to this view object's row set.
 AttributeDef addDynamicAttributeWithType(java.lang.String attrName, java.lang.String javaTypeName, java.lang.String transientExpression)
           
 void addInternalListener(java.lang.Object target)
           
 void addListener(java.lang.Object target)
          Adds a subscriber (listener) to be notified of RowSetListener events generated by this row set iterator.
 void addManagementListener(RowSetManagementListener target)
          Adds a subscriber (listener) to be notified of RowSetManagementListener events generated by this Row Set Iterator.
 void addQueryMode(int queryMode)
          Adds query mode for the view object.
protected  void addViewLink(ViewLink viewLink)
           
 AttributeDef addViewLinkAccessor(java.lang.String accrName)
           
 void applyViewCriteria(ViewCriteria criteria)
          Applies the view criteria to this view object.
 void applyViewCriteria(ViewCriteria criteria, boolean bAppend)
          Applied the view criteria to this view object.
 CriteriaClauses buildViewCriteriaClauses(ViewCriteria vc)
          This method is used by the framework to generate a query clause for a particular view criteria.
 boolean cancelQuery()
          Cancels a running query.
 void clearCache()
          Clears the view object cache.
 void clearViewCriterias()
          Clear all view criteria, both applied and unapplied help by this manager
 void closeRowSet()
          Closes the row set.
 void closeRowSetIterator()
          Closes this row set iterator.
 Row createAndInitRow(AttributeList nvp)
          Creates and initializes a new Row object, but does not insert it into the Row Set.
 RowSet createDetailRowSet(java.lang.String voName, java.lang.String linkDefName)
          Create a row set for the view link.
 Key createKey(AttributeList nvp)
          Given a set of attribute values (name-value pairs), creates a key object for this ViewObject.
 Row createRow()
          Creates a new Row object, but does not insert it into the Row Set.
 RowSet createRowSet(java.lang.String name)
          Creates and returns a new (secondary) row set for this view object.
 RowSetIterator createRowSetIterator(java.lang.String name)
          Creates an iterator for the row set.
 ViewCriteria createViewCriteria()
          View Criteria factory
 void criteriaChanged(ViewCriteria vc)
          The criteria manager can track changes to applied view criteria.
 RowSet deepCopy(java.util.HashMap voAttrMap, long options)
          This method delegates to the default RowSet.
 void defineNamedWhereClauseParam(java.lang.String name, java.lang.Object defaultValue, int[] indices)
          Defines a named bind variable to use with the view object's where-clause.
 VariableValueManager ensureVariableManager()
          Returns this object's Variable Value Manager.
 java.util.Enumeration enumerateRowsInRange()
          Gets an Enumeration of all rows in the Row Set.
 void executeEmptyRowSet()
           
 void executeQuery()
          Executes the query.
protected  void finalize()
          void addRowCount(Object rowHandle) { Integer entry = (Integer) mRowCount.get(rowHandle); if (entry == null) { mRowCount.put(rowHandle, new Integer(1)); } else { mRowCount.put(rowHandle, new Integer(entry.intValue() + 1)); } } boolean releaseRowCount(Object rowHandle) { Integer entry = (Integer) mRowCount.get(rowHandle); int useCount = entry.intValue(); Diagnostic.ASSERT(entry != null, "Cannot find row use entry for handle = " + ((Integer) rowHandle).intValue()); if (useCount == 1) { mRowCount.remove(rowHandle); return true; } else { mRowCount.put(rowHandle, new Integer(useCount - 1)); return false; } }
 void findAndSetCurrentRowByKey(Key k, int rangeIndex)
           
 AttributeDef findAttributeDef(java.lang.String name)
          Gets an attribute definition, given its name.
 RowIterator findByAltKey(java.lang.String keyName, Key key, int maxNumOfRows, boolean skipWhere)
          Same as RowIterator.findByKey(Key, int) with a few extra functionalities.
 Row[] findByEntity(int eRowHandle, int maxNumOfRows)
          Finds and returns View rows that use the Entity row, identified by the Entity row handle, eRowHandle.
 Row[] findByKey(Key key, int maxNumOfRows)
          Finds and returns View rows that match the specified key.
 RowIterator findByViewCriteria(ViewCriteria criteria, int maxNumOfRows, int queryMode)
          Finds and returns View rows that match the specified View Criteria.
 ListBindingDef findListBindingDef(java.lang.String name)
          Return listbinding definition if defined in this ViewObject (or in the entity definitions for entities that this ViewObject constitutes of).
 OperationDefinitions findOperationDefinitions()
           
 RowSet findRowSet(java.lang.String name)
          Gets the named row set that was created at runtime for this view object.
 RowSetIterator findRowSetIterator(java.lang.String name)
          Gets the named row set iterator that was created at runtime for this row set.
 AttributeDef findViewLinkAccessor(ViewLink vl)
          Finds the view link accessor attribute.
 Row first()
          Gets the first row in the iterator.
 byte getAccessMode()
           
 int getActivationMode()
           
 Row[] getAllRowsInRange()
          Extracts the rows in the range.
 java.lang.String[] getAllViewCriteriaNames()
          Returns a list of both applied and unapplied view criterias managed by this object.
 ViewCriteria[] getAllViewCriterias()
          Returns a list of both applied and unapplied view criterias managed by this object.
 ApplicationModule getApplicationModule()
          Gets the row set's application module that contains this row set.
protected  ApplicationModuleImpl getApplicationModuleProxy()
           
 java.lang.String[] getApplyViewCriteriaNames()
           
 ViewCriteria[] getApplyViewCriterias(int criteriaMode)
          Return a list of applied view criteria that have the mode passed in the argument turned on.
 AttributeDef[] getAttrDefsForEntityAttr(java.lang.String eoName, java.lang.String eoAttrName)
          This method performs the same operation as getAttrIndicesForEntityAttr, except that it return an array of attribute definitions, not just indices.
 int getAttributeCount()
          Returns the number of defined attributes.
 AttributeDef getAttributeDef(int index)
          Gets an attribute definition, given its index.
 AttributeDef[] getAttributeDefs()
          Gets the defined attributes.
 int getAttributeIndexOf(java.lang.String name)
          Finds the index (0-based) of the named attribute.
 int[] getAttrIndicesForEntityAttr(java.lang.String eoName, java.lang.String eoAttrName)
          Returns an array of indices of view attributes that are mapped to the entity attribute identified by the entity name (the eoName parameter) and the entity attribute name (the eoAttrName).
 java.lang.String[] getAvailableViewCriteriaNames()
          Returns a list of view criteria names that are unapplied and managed by this object
 long getCappedRowCount(long cap)
           
 SvcMsgIteratorState getCliIteratorState()
           
 java.lang.String getColumnNameForQuery(int index)
           
 Row getCurrentRow()
          Accesses the current row.
 int getCurrentRowIndex()
          Gets the absolute index (not range index) of the current row.
 int getCurrentRowSlot()
          Gets the slot status of the current row.
 SortCriteria[] getDBSortCriteria()
           
 long getDeferredEstimatedRowCount()
          If this ViewObject is marked to not perform the estimatedRowCount query, then return -1 until either the estimatedRowCount is called and the count is known or the RowSet is fetched completely in which case the actual row count is known.
 java.lang.String getDefFullName()
          Returns the fully qualified name of the structure's base definition.
 java.lang.String getDefName()
          Returns the structure's base definition name (short form).
 RowSet[] getDetailRowSets()
          Get all detail Row Sets for this View Object.
 int getDynamicAttributeCount()
           
 int getDynamicAttributeOffset()
           
 int getEstimatedRangePageCount()
          Returns getEstimatedRowCount()/rangePageSize, if rangeSize > 0.
 long getEstimatedRowCount()
          Counts the number of rows in the collection defined by the view object's query.
 int getFetchedRowCount()
          Counts the number of rows fetched from database into the Row Set collection up to this point.
 Row[] getFilteredRows(java.lang.String attrName, java.lang.Object attrValue)
          Returns all rows in this collection whose attribute value matches the value being passed in attrValue.
 Row[] getFilteredRowsInRange(java.lang.String attrName, java.lang.Object attrValue)
          Returns all rows in this range whose attribute value matches the value being passed in attrValue.
 java.lang.String getFullName()
          Returns the structure's fully qualified name.
 java.lang.String getImageLoc(boolean bOpen)
           
static oracle.jbo.client.remote.RowSetIteratorImpl getImplObject(java.lang.Object rsi)
           
 java.lang.String getInterfaceName()
           
 int getIterMode()
          Gets the current iteration mode.
 AttributeDef[] getKeyAttributeDefs()
          Returns the attribute definitions that make up the constituents of the key object for rows returned from this view object.
 RowSetIterator[] getMasterRowSetIterators()
          Return all controlling masters of this row set.
 int getMaxFetchSize()
          Maximum number of rows to fetch for this view object.
 java.lang.Class getMessageBundleClass()
           
 java.lang.String getName()
          Returns the structure's name (short form).
 java.lang.Object getNamedWhereClauseParam(java.lang.String name)
          Gets the value of a named where-clause parameter for this row set.
 AttributeList getNamedWhereClauseParams()
          Gets all the Name, value pairs of a named where-clause parameter of the viewObject.
 Row[] getNextRangeSet()
          Gets the next set of rows in the range.
protected  ObjectMarshaller getObjectMarshaller()
           
 java.lang.String getOrderByClause()
          Returns the query's ORDER BY clause.
 java.lang.Object getParent()
           
protected  byte[] getPiggyback()
           
 Row[] getPreviousRangeSet()
          Gets the previous set of rows in the range.
 java.util.Hashtable getProperties()
          Gets the table of properties.
 java.lang.String getQuery()
          Returns the query statement.
 int getQueryMode()
          Gets the current query mode of this view object.
 java.lang.String getQueryOptimizerHint()
          Returns query optimizer Hint set for this ViewObject or for its definition object.
 int getQueryTimeOut()
          Returns the current query time out value.
 int getRangeIndexOf(Row row)
          Get the index of the given row relative to the beginning of the range.
 int getRangePagingCacheFactor()
           
 int getRangeSize()
          Gets the size of the Row Set Iterator range.
 int getRangeStart()
          Gets the absolute row index of the first row in the Row Set Iterator range.
 int getRemoteId()
           
 ViewCriteria getRequiredViewCriteria()
          This method returns a reference to the required view criteria if one exists on this View Object.
 ResourceBundleDef getResourceBundleDef()
           
 byte getROTEntryType()
           
 Row getRow(Key key)
          Locates and returns a row by its unique key.
 Row getRowAtRangeIndex(int index)
          Accesses a row through its range index.
 int getRowCount()
          Counts the total number of rows in the Row Set.
 int getRowCountInRange()
          Gets the size of the Row Set Iterator range.
 java.lang.Object[] getRowFilterValues()
           
 RowMatch getRowMatch()
          Gets the in-memory filter (RowMatch) for the view object.
 RowSet getRowSet()
          Gets the Row Set that this Iterator belongs to.
 RowSetIterator getRowSetIterator()
           
 RowSetIterator[] getRowSetIterators()
          Gets all row set iterators that belong to this row set.
 RowSet[] getRowSets()
          Get all Row Sets that belong to this View Object.
protected  ServiceMessage getServiceMessage()
           
 java.lang.String getSortBy()
           
 StructureDef getStructDef()
           
 java.lang.String[] getSubstitutedDefNames()
          Returns an array of fully qualified view definition names that are substituted by this view object's definition.
 java.lang.Object getSyncLock()
          Gets the locking object for this Row Set Iterator.
 VariableValueManager getVariableManager()
          Returns this object's current Variable Value Manager.
 java.util.ArrayList getVariableOpers()
           
 ViewCriteria getViewCriteria()
          Gets the view criteria.
 ViewCriteria getViewCriteria(java.lang.String name)
          Returns a reference to the view criteria with a specific name if it is found.
 java.lang.String getViewCriteriaClause(boolean forQuery)
          This method is used by the framework to generate a query clause for the applied view criterias.
 ViewCriteriaManager getViewCriteriaManager()
           
 java.lang.String[] getViewLinkNames()
          Constructs an array of names of view links that involve this view object.
protected  ViewLink[] getViewLinks()
           
 ViewObject getViewObject()
          Gets the view object that owns this row set.
 java.lang.String getWhereClause()
          Gets the query's where-clause.
 java.lang.Object[] getWhereClauseParams()
          Gets the bind variable values to be used with the view object's where-clause.
 boolean hasNext()
          Tests for the existence of a row after the current row.
 boolean hasPrevious()
          Tests for the existence of a row before the current row.
 boolean hasVariables()
          Returns a flag indicating whether this object has Variables or not.
protected  void init(ApplicationModuleImpl appModule, int voId, java.lang.String name, java.lang.String fullName, java.lang.String defName, java.lang.String defFullName, java.lang.String[] substitutedDefNames, ResourceBundleDef resBundleDef, boolean isRO)
           
 void insertRow(Row row)
          Inserts a row to the Row Set, before the current row.
 void insertRowAtRangeIndex(int index, Row row)
          Inserts a row to the Row Set at the given range index.
 boolean isAssociationConsistent()
          Returns the flag indicating whether association-consistent mode is on or not.
 boolean isDefaultRowSet()
          Internal: Applications should not use this method.
 boolean isExecuted()
          Returns true if the current ViewObject's query has been executed for this row set.
 boolean isFetchComplete()
          Tests if the query result set has been fetched to the end.
 boolean isForwardOnly()
          Tests if the row set is constrained to sequential access.
 boolean isInternal()
          Returns whether this view object was created internally by BC4J or by an explicit user request.
 boolean isMaxFetchSizeExceeded()
          Tests if the query result has been fetched to the end and the end was reached due to hitting the maxFetchSize limit
 boolean isNameGenerated()
          Tests if the Iterator's name was generated by the system.
 boolean isRangeAtBottom()
          Tests if the Row Set Iterator range is at the end of the result set.
 boolean isRangeAtTop()
          Tests if the Row Set Iterator range is at the beginning of the result set.
 boolean isReadOnly()
          Tests if the view object is read-only.
 boolean isRowValidation()
          Gets the validation flag on this iterator.
 Row last()
          Gets the last row in the iterator.
 AttributeDef lookupAttributeDef(java.lang.String name)
          Gets an attribute definition, given its name.
 ListBindingDef lookupListBindingDef(java.lang.String lbName)
          Return listbinding definition if defined in this ViewObject (or in the entity definitions for entities that this ViewObject constitutes of).
 void mergeVariableValues(Variable[] vars, java.lang.Object[] varVals)
           
 void navigated(NavigationEvent event)
          Invoked when the current-row designation changes.
 boolean needsRefresh()
           
 Row next()
          Gets the next row in the iterator.
 void prepareForBatchMode(SvcMsgIteratorState iteratorState, boolean setCurrentRow)
           
 Row previous()
          Gets the previous row in the iterator.
protected  void processPiggyback(byte[] pb)
           
protected  java.util.ArrayList processServiceMessage(ServiceMessage svcMsg)
           
 void putViewCriteria(java.lang.String name, ViewCriteria vc)
          Add a view criteria to be managed by this object
 void rangeRefreshed(RangeRefreshEvent event)
          Invoked when the range changes.
 void rangeScrolled(ScrollEvent event)
          Invoked when the range is scrolled.
 void readRowXML(Element elem, int depthCount)
          Reads the data in XML form (in the format as generated by writeXML()) by finding a row that matches the key in the given XML and then reading in that row.
 void readRowXML(Element elem, int depthCount, XSLStylesheet xslt)
           
 void readXML(Element elem, int depthCount)
           
 void readXML(Element elem, int depthCount, XSLStylesheet xslt)
           
 java.util.Hashtable refreshProperties()
           
 java.lang.Object refreshProperty(java.lang.String hintName)
          Retrieves the specified property, if it exists.
 void remove()
          Deletes this component.
 boolean removeApplyViewCriteriaName(java.lang.String name)
          Unapplied the view criteria if it is applied.
 void removeCurrentRow()
          Removes the current Row object from the Row Set.
 Row removeCurrentRowAndRetain()
          Removes the current Row object from the collection and retain it for insertion into another location.
 void removeCurrentRowFromCollection()
          Removes the current Row object from the collection.
 void removeInternalListener(java.lang.Object target)
           
 void removeListener(java.lang.Object target)
          Removes a subscriber (listener) for RowSetListener events generated by this row set iterator.
 void removeManagementListener(RowSetManagementListener target)
          Removes a subscriber (listener) for RowSetManagementListener events generated by this row set iterator.
 boolean removeMasterRowSetIterator(RowSetIterator masterRS)
          Removes a master row set iterator.
 void removeNamedWhereClauseParam(java.lang.String name)
          Removes a named where-clause parameter.
 ViewCriteria removeViewCriteria(java.lang.String name)
          Removes the view criteria from this manager.
protected  void removeViewLink(ViewLinkImpl viewLink)
           
 void reset()
          Moves the currency to the slot before the first row.
 void resetCriteria(ViewCriteria vc)
          Resets a view criteria to the state as defined in the View Definition.
 void resetVariableOpers()
           
 void rowDeleted(DeleteEvent event)
          Invoked when a row has been deleted.
 void rowInserted(InsertEvent event)
          Invoked when a row has been inserted.
 void rowUpdated(UpdateEvent event)
          Invoked when an attribute of the row has been changed.
 int scrollRange(int amount)
          Moves the Row Set Iterator range up or down a given number of rows.
 int scrollRangeTo(Row row, int index)
          Scrolls the range to place a given row at a given range index.
 int scrollToRangePage(int pageIndex)
          Moves the row set range start to the given page index where every page consists of RangeSize number of rows.
 void setAccessMode(byte mode)
          Constrains the row access based on the following settings:
 void setApplyViewCriteriaName(java.lang.String name)
          Apply the view criteria name passed as the argument.
 void setApplyViewCriteriaName(java.lang.String name, boolean bAppend)
          Apply the view crtieria name passed as the argument.
 void setApplyViewCriteriaNames(java.lang.String[] names)
          Apply a set of view criteria names passed as the argument.
 void setAssociationConsistent(boolean isConsistent)
          Sets the association-consistent flag for this row set.
 boolean setCurrentRow(Row row)
          Designates a given row as the current row.
 boolean setCurrentRowAtRangeIndex(int index)
          Designates a given index as the current row.
 void setCurrentUnionViewCriteriaName(java.lang.String vcName)
           
 void setDBSortCriteria(SortCriteria[] sortCriteria)
          Set declarative sort criteria for database queries.
 void setForwardOnly(boolean isForwardOnly)
          Constrains the row set to sequential access.
 void setIterMode(int mode)
          Sets the iteration mode for this Row Iterator.
 void setListBindingsInternal(java.util.HashMap al)
           
 boolean setMasterRowSetIterator(RowSetIterator masterRS)
          Sets the master iterator.
 void setMaxFetchSize(int max)
          Maximum number of rows to fetch for this view object.
 void setNamedWhereClauseParam(java.lang.String name, java.lang.Object value)
          Sets the value of a named where-clause parameter for this row set.
 void setNamedWhereClauseParams(AttributeList attrlist)
          Sets the value of a named where-clause parameters for the entire viewObject.
 void setOrderByClause(java.lang.String expr)
          Sets the ORDER BY clause of the view object's query statement.
 void setProperty(java.lang.String hintName, java.lang.Object hintValue)
           
 void setQueryMode(int queryMode)
          Sets query mode for the view object.
 void setQueryOptimizerHint(java.lang.String hintText)
          If this ViewObject does not have an expert mode query, then this hint is added to the select clause of the SQL for this ViewObject before the columns are listed e.g., SELECT \/*+ <hintText> *\/ columns...
 void setQueryTimeOut(int queryTimeOut)
          Sets the query time out value for the view object.
 void setRangePagingCacheFactor(int f)
           
 int setRangeSize(int size)
          Modifies the size of the Row Set Iterator range.
 int setRangeStart(int start)
          Moves the Row Set Iterator range.
 void setRequiredViewCriteria(ViewCriteria vc)
          Setting a view criteria as required will enforce the criteria whenever the view object's query is executed.
 void setRowFilterValues(java.lang.Object[] rowFilterValues)
           
 void setRowMatch(RowMatch rowMatch)
          Sets an in-memory filter (RowMatch) for the view object.
 void setRowValidation(boolean flag)
          Sets the validation flag on this iterator.
 void setSortBy(java.lang.String sortBy)
          Specify a clause to perform in-memory sorting.
 void setWhereClause(java.lang.String cond)
          Sets a where-clause bind value of the view object's query statement.
 void setWhereClauseParam(int index, java.lang.Object value)
          Specifies a single bind variable value to use with the view object's where-clause.
 void setWhereClauseParams(java.lang.Object[] values)
          Specifies the bind variable values to use with the view object's where-clause.
 void skipNamedWhereClauseParam(java.lang.String name)
          Skips the named where-clause parameter for this row set.
 Node writeXML(int depthCount, long options)
          Renders data in a canonical XML-format.
 Node writeXML(int depthCount, long options, XSLStylesheet xslt)
           
 Node writeXML(long options, java.util.HashMap voAttrMap)
          Renders data in a canonical XML-format.
 Node writeXML(long options, java.util.HashMap voAttrMap, XSLStylesheet xslt)
           

 

Methods inherited from class oracle.jbo.common.PropertiesHelper
closeObject, getProperty, getProperty, setName

 

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

 

Methods inherited from interface oracle.jbo.Properties
getProperty, getProperty

 

Field Detail

mName

protected java.lang.String mName

mFullName

protected java.lang.String mFullName

mDefName

protected java.lang.String mDefName

mDefFullName

protected java.lang.String mDefFullName

mId

protected int mId

mAM

protected ApplicationModuleImpl mAM

mStruct

protected StructureDefImpl mStruct

mDefaultRowSet

protected RowSet mDefaultRowSet

mIsInternal

protected boolean mIsInternal

mIsReadOnly

protected boolean mIsReadOnly

mViewLinks

protected java.util.ArrayList mViewLinks

mCriteria

protected ViewCriteria mCriteria

mCriteriaGotten

protected boolean mCriteriaGotten

mRowProxyClassName

protected java.lang.String mRowProxyClassName

mInterfaceName

protected java.lang.String mInterfaceName

Constructor Detail

ViewUsageImpl

protected ViewUsageImpl()

Method Detail

getSyncLock

public final java.lang.Object getSyncLock()
Description copied from interface: RowSetIterator
Gets the locking object for this Row Set Iterator. Actually, this method locks the Application Module to which this Row Set Iterator belongs. See ApplicationModule.getSyncLock() for details.
Specified by:
getSyncLock in interface RowSetIterator
Returns:
the locking object.

isNameGenerated

public final boolean isNameGenerated()
Description copied from interface: RowSetIterator
Tests if the Iterator's name was generated by the system.
Specified by:
isNameGenerated in interface RowSetIterator
Returns:
true if the name was generated by the system. false if the name was given by the user and not generated by the system.

isInternal

public final boolean isInternal()
Description copied from interface: ViewObject
Returns whether this view object was created internally by BC4J or by an explicit user request.
Specified by:
isInternal in interface ViewObject
Returns:
a flag indicating whether the view object is internal or not.

getInterfaceName

public java.lang.String getInterfaceName()

init

protected void init(ApplicationModuleImpl appModule,
                    int voId,
                    java.lang.String name,
                    java.lang.String fullName,
                    java.lang.String defName,
                    java.lang.String defFullName,
                    java.lang.String[] substitutedDefNames,
                    ResourceBundleDef resBundleDef,
                    boolean isRO)

getName

public java.lang.String getName()
Description copied from interface: StructureDef
Returns the structure's name (short form).
Specified by:
getName in interface ClientComponentObject
Specified by:
getName in interface ComponentObject
Specified by:
getName in interface RowSet
Specified by:
getName in interface RowSetIterator
Specified by:
getName in interface StructureDef
Specified by:
getName in interface VariableManagerOwner
Returns:
name of the structure.

getFullName

public java.lang.String getFullName()
Description copied from interface: StructureDef
Returns the structure's fully qualified name.
Specified by:
getFullName in interface ClientComponentObject
Specified by:
getFullName in interface ComponentObject
Specified by:
getFullName in interface StructureDef
Returns:
fully qualified name of the structure.

getImageLoc

public java.lang.String getImageLoc(boolean bOpen)
Overrides:
getImageLoc in class PropertiesHelper

getDefName

public java.lang.String getDefName()
Description copied from interface: StructureDef
Returns the structure's base definition name (short form). Note that, in some cases, a StructureDef may have an instance name and definition name. For example, for a View Object, getName() returns the VO's instance name and getDefName() returns the View definition's name.
Specified by:
getDefName in interface ComponentObject
Specified by:
getDefName in interface StructureDef
Returns:
name of the structure's base definition.

getDefFullName

public java.lang.String getDefFullName()
Description copied from interface: StructureDef
Returns the fully qualified name of the structure's base definition. Note that, in some cases, a StructureDef may have an instance name and definition name. For example, for a View Object, getFullName() returns the VO's full instance name and getDefFullName() returns the View definition's full name.
Specified by:
getDefFullName in interface ComponentObject
Specified by:
getDefFullName in interface StructureDef
Returns:
fully qualified name of the structure's base definition.

getSubstitutedDefNames

public java.lang.String[] getSubstitutedDefNames()
Description copied from interface: ViewObject
Returns an array of fully qualified view definition names that are substituted by this view object's definition.

This method finds substituted def names recursively. That is, If A is substituted by B, and B by C, calling this method on a view object of C returns B and A.

Specified by:
getSubstitutedDefNames in interface ViewObject
Returns:
an array of fully qualified view definition names. null if this view object's definition does not substitute any other view definition.

getActivationMode

public int getActivationMode()
Specified by:
getActivationMode in interface WSViewObjectMarshaller

remove

public void remove()
Description copied from interface: ComponentObject
Deletes this component.
Specified by:
remove in interface ComponentObject

getRemoteId

public int getRemoteId()
Specified by:
getRemoteId in interface ClientComponentObject

getROTEntryType

public byte getROTEntryType()
Specified by:
getROTEntryType in interface ClientComponentObject

setListBindingsInternal

public void setListBindingsInternal(java.util.HashMap al)

getStructDef

public StructureDef getStructDef()

findOperationDefinitions

public OperationDefinitions findOperationDefinitions()
Specified by:
findOperationDefinitions in interface OperationContainer

getAttributeDefs

public AttributeDef[] getAttributeDefs()
Description copied from interface: StructureDef
Gets the defined attributes.
Specified by:
getAttributeDefs in interface StructureDef
Returns:
an array of attribute definitions.

getAttributeCount

public int getAttributeCount()
Description copied from interface: StructureDef
Returns the number of defined attributes.
Specified by:
getAttributeCount in interface StructureDef
Returns:
the number of attributes.

findAttributeDef

public AttributeDef findAttributeDef(java.lang.String name)
Description copied from interface: StructureDef
Gets an attribute definition, given its name.
Specified by:
findAttributeDef in interface StructureDef
Parameters:
name - the name of an AttributeDef.
Returns:
an attribute definition

lookupAttributeDef

public AttributeDef lookupAttributeDef(java.lang.String name)
Description copied from interface: StructureDef
Gets an attribute definition, given its name.
Specified by:
lookupAttributeDef in interface StructureDef
Parameters:
name - the name of an AttributeDef.
Returns:
an attribute definition if found, null otherwise

getAttributeDef

public AttributeDef getAttributeDef(int index)
Description copied from interface: StructureDef
Gets an attribute definition, given its index.
Specified by:
getAttributeDef in interface StructureDef
Parameters:
index - the index of an AttributeDef, where the leftmost attribute has index zero.
Returns:
an attribute definition.

getAttributeIndexOf

public int getAttributeIndexOf(java.lang.String name)
Description copied from interface: StructureDef
Finds the index (0-based) of the named attribute.
Specified by:
getAttributeIndexOf in interface StructureDef
Parameters:
name - the attribute's name.
Returns:
an integer in the range 0 to getAttributeCount() - 1. If the named attribute is not found, it returns -1.

getColumnNameForQuery

public java.lang.String getColumnNameForQuery(int index)
Specified by:
getColumnNameForQuery in interface StructureDef

getKeyAttributeDefs

public AttributeDef[] getKeyAttributeDefs()
Description copied from interface: ViewObject
Returns the attribute definitions that make up the constituents of the key object for rows returned from this view object.

This method is used to pass AttributeDef[] to the Key.Key(String, AttributeDef[]) constructor to parse the constituent-bytes and convert them into value-objects that make up the key.

Use this method to find out how the key is composed for the view row. The view object's key is a composite key, consisting of view attributes mapped to the primary keys of its entity objects.

Specified by:
getKeyAttributeDefs in interface ViewObject
Returns:
the array of attribute definitions.

getAttrDefsForEntityAttr

public AttributeDef[] getAttrDefsForEntityAttr(java.lang.String eoName,
                                               java.lang.String eoAttrName)
This method performs the same operation as getAttrIndicesForEntityAttr, except that it return an array of attribute definitions, not just indices.
Specified by:
getAttrDefsForEntityAttr in interface ViewObject
Parameters:
eoName - fully qualified name of the entity object.
eoAttrName - entity object attribute name.
Returns:
the array of attribute definitions ov VO attrs that are mapped to the entity attribute. If no view attribute is mapped to the entity attribute, an empty array (of length 0) is returned.
See Also:
getAttrIndicesForEntityAttr(String, String)

getAttrIndicesForEntityAttr

public int[] getAttrIndicesForEntityAttr(java.lang.String eoName,
                                         java.lang.String eoAttrName)
Returns an array of indices of view attributes that are mapped to the entity attribute identified by the entity name (the eoName parameter) and the entity attribute name (the eoAttrName).

Note that it returns an array because more than one view object attribute may be mapped to one entity attribute.

This method can be used to identify view attributes that map into a particular entity object attribute. In particular, if a validation error fails on an entity attribute, this method can be used to find view attributes that map into that entity attribute.

Parameters:
eoName - fully qualified name of the entity object.
eoAttrName - entity object attribute name.
Returns:
the array of indices of view attributes that are mapped to the entity attribute. If no view attribute is mapped to the entity attribute, an empty array (of length 0) is returned.

setWhereClause

public void setWhereClause(java.lang.String cond)
Description copied from interface: ViewObject
Sets a where-clause bind value of the view object's query statement.

Bind variables can be specified using '?' as a place-holder for the value.

The new where-clause does not take effect until RowSet.executeQuery() is called. If the where-clause contains where-clause parameters, RowSet.setWhereClauseParam(int, Object) or RowSet.setWhereClauseParams(Object[]) needs to be called before executeQuery().

Note that calling setWhereClause() does not clear the previous settings of where-clause parameters. To reset where-clause parameters in the middle tier, call RowSet.setWhereClauseParams(Object[]) explicitly with a null value. For example:

 vo.setWhereClauseParams(null);
 
This method should not be overridden.
Specified by:
setWhereClause in interface ViewObject
Parameters:
cond - a where-clause, but excluding the 'WHERE' keyword.

getWhereClause

public java.lang.String getWhereClause()
Description copied from interface: ViewObject
Gets the query's where-clause. If the query does not have a where-clause, this method returns null.

This where-clause is obtained from the view object instance. In the middle tier, to get the complete where-clause built from the view object instance, the view definition, the view criteria, and the view links use ViewObjectImpl.buildWhereClause(java.lang.StringBuffer, int)

Specified by:
getWhereClause in interface ViewObject
Returns:
the where-clause, excluding the 'WHERE' keyword; null if no where-clause exists.

setNamedWhereClauseParams

public void setNamedWhereClauseParams(AttributeList attrlist)
Description copied from interface: RowSet
Sets the value of a named where-clause parameters for the entire viewObject.

Setting a named where-clause parameter does not automatically execute the query. You must call RowSet.executeQuery() to apply the new bind value.

Specified by:
setNamedWhereClauseParams in interface RowSet
Parameters:
attrlist - is a Name, value pair of bind variables.

getNamedWhereClauseParams

public AttributeList getNamedWhereClauseParams()
Description copied from interface: RowSet
Gets all the Name, value pairs of a named where-clause parameter of the viewObject.

It uses the method getNamedWhereClauseParam to return all the name,value pairs from VariableValueManager.

Specified by:
getNamedWhereClauseParams in interface RowSet
Returns:
an AttributeList of name, value pairs of all named bind variables.

setWhereClauseParams

public void setWhereClauseParams(java.lang.Object[] values)
Description copied from interface: RowSet
Specifies the bind variable values to use with the view object's where-clause.

Setting the where-clause bind values through this method does not automatically execute the query. You must call RowSet.executeQuery() to apply the new bind values.

Specified by:
setWhereClauseParams in interface RowSet
Parameters:
values - an array of bind values. If the view object is using the JDBC style bindings ("?" for bind variable), values[n] is bound to the bind variable that appears in the n-th order (0 based indexing). If the view object is using the Oracle style bindings (":1", ":2", etc. for bind variable), values[n] is bound to the bind variable :(n+1), i.e., values[0] is bound to :1, values[1] is bound to :2, etc.

setWhereClauseParam

public void setWhereClauseParam(int index,
                                java.lang.Object value)
Description copied from interface: RowSet
Specifies a single bind variable value to use with the view object's where-clause.

Setting the where-clause bind values through this method does not automatically execute the query. You must call RowSet.executeQuery() to apply the new bind values.

Specified by:
setWhereClauseParam in interface RowSet
Parameters:
index - the index identifying the bind variable. If the view object is using the JDBC style bindings ("?" for bind variable), value is bound to the bind variable that appears in the index-th order (0 based indexing). If the view object is using the Oracle style bindings (":1", ":2", etc. for bind variable), value is bound to the bind variable :(index+1). If index is 0, value is bound to :1. If index is 1, value is bound to :2.
value - the bind variable value.

defineNamedWhereClauseParam

public void defineNamedWhereClauseParam(java.lang.String name,
                                        java.lang.Object defaultValue,
                                        int[] indices)
Description copied from interface: RowSet
Defines a named bind variable to use with the view object's where-clause.

This named where-clause parameter will be defined as a variable on the view object. That is, if a named where-clause parameter is defined through one row set, all other row sets that belongs to the same parent view object will "see" that parameter.

Through the defaultValue, one can specify the default value for this where-clause parameter. If no default value is supplied, null will be used as the parameter value.

The indices parameter specifies where-clause parameter indices into which this named parameter will be bound. The same value can be bound into multiple indices. For example, if { 1, 2 } is specified for indices, the value will be bound for where-clause parameter indices of 1 and 2. I.e., this parameter will produce setWhereClauseParam(1, value) and setWhereClauseParam(2, value).

This method can be invoked to redefine an existing named where-clause paramter (to change the default value and the indices) only if the named parameter is found on the view object. If the named parameter/variable is found on one of the parent objects, a new where-clause parameter definition is still added to the view object.

When redefining, a check is made to ensure that the existing variable has no kind specification (null) or is of the "where" kind (which means that the existing variable is a where-clause parameter). If not, an InvalidParamException is thrown.

Defining a named where-clause parameter does not automatically execute the query. You must call RowSet.executeQuery() to apply the new bind value.

Specified by:
defineNamedWhereClauseParam in interface RowSet
Parameters:
name - the name of the where-clause parameter.
defaultValue - specifies the default value for this where-clause parameter. This default value can be overridden through a call to setNamedWhereClauseParam().
indices - where-clause indices into which this parameter value should be bound. See above.

removeNamedWhereClauseParam

public void removeNamedWhereClauseParam(java.lang.String name)
Description copied from interface: RowSet
Removes a named where-clause parameter.

This method removes previously defined named where-clause parameter. A check is made to ensure that the variable being removed is a where-clause parameter (variable kind = "where"). If not, an InvalidParamException is thrown.

If the named where-clause parameter is found but it does not belong to the view object that owns this row set, an InvalidOperException is thrown. This means one is disallowed from removing a named where-clause parameter that belongs to the View definition, for example.

Removing a named where-clause parameter does not automatically execute the query. You must call RowSet.executeQuery() for the removal to take effect.

Specified by:
removeNamedWhereClauseParam in interface RowSet
Parameters:
name - the name of the where-clause parameter to remove.

getNamedWhereClauseParam

public java.lang.Object getNamedWhereClauseParam(java.lang.String name)
Description copied from interface: RowSet
Gets the value of a named where-clause parameter for this row set.

If the view object owns multiple row sets, each row set may have its own (different) named where-clause parameter value.

Specified by:
getNamedWhereClauseParam in interface RowSet
Parameters:
name - the name of the where-clause parameter.

setNamedWhereClauseParam

public void setNamedWhereClauseParam(java.lang.String name,
                                     java.lang.Object value)
Description copied from interface: RowSet
Sets the value of a named where-clause parameter for this row set.

If the view object owns multiple row sets, each row set may have its own (different) named where-clause parameter value.

Setting a named where-clause parameter does not automatically execute the query. You must call RowSet.executeQuery() to apply the new bind value.

Specified by:
setNamedWhereClauseParam in interface RowSet
Parameters:
name - the name of the where-clause parameter.
value - the where-clause parameter value for this row set.

skipNamedWhereClauseParam

public void skipNamedWhereClauseParam(java.lang.String name)
Description copied from interface: RowSet
Skips the named where-clause parameter for this row set. This method does not remove the named where-clause parameter. However, it "masks out" the named where-clause parameter, so that the parameter is skipped when the query is executed.

Skipping a named where-clause parameter does not automatically execute the query. You must call RowSet.executeQuery() for the skip to take effect.

Specified by:
skipNamedWhereClauseParam in interface RowSet
Parameters:
name - the name of the where-clause parameter.

getWhereClauseParams

public java.lang.Object[] getWhereClauseParams()
Description copied from interface: RowSet
Gets the bind variable values to be used with the view object's where-clause.
Specified by:
getWhereClauseParams in interface RowSet
Returns:
an array of bind-variable values.

setOrderByClause

public void setOrderByClause(java.lang.String expr)
Description copied from interface: ViewObject
Sets the ORDER BY clause of the view object's query statement. Bind variables can be specified using '?' as a place-holder for the value. The new ORDER BY clause does not take effect until RowSet.executeQuery() is called.

This method should not be overridden.

Specified by:
setOrderByClause in interface ViewObject
Parameters:
expr - a ORDER BY clause, but excluding the 'ORDER BY' keywords.

getOrderByClause

public java.lang.String getOrderByClause()
Description copied from interface: ViewObject
Returns the query's ORDER BY clause. If the query does not have an ORDER BY clause, this method returns null.

This method should not be overridden.

Specified by:
getOrderByClause in interface ViewObject
Returns:
a ORDER BY clause, but excluding the 'ORDER BY' keyword. null if the SQL statement has no ORDER BY clause.

getQuery

public java.lang.String getQuery()
Description copied from interface: ViewObject
Returns the query statement. Unlike ViewObjectImpl.getUserDefinedQuery() this method will return a SQL statement regardless of whether the query was created in expert or non-expert Mode.
Specified by:
getQuery in interface ViewObject
Returns:
the user-defined SQL query if one exists, otherwise, a query statement is assembled from defined from, where, and order by clauses.

setDBSortCriteria

public void setDBSortCriteria(SortCriteria[] sortCriteria)
Description copied from interface: ViewObject
Set declarative sort criteria for database queries. Each sort criteria is based on one view object attribute with an option to sort in a case or case-insensitive fashion and ascending or descending order. These criteria will be used to generate an orderby clause during database query.
Specified by:
setDBSortCriteria in interface ViewObject
Parameters:
sortCriteria - an array of database sort criteria with an element for each attribute to sort with

getDBSortCriteria

public SortCriteria[] getDBSortCriteria()
Specified by:
getDBSortCriteria in interface ViewObject
Returns:
Get the applied declarative sort criteria for database queries. See ViewObject.setDBSortCriteria(SortCriteria[]).

setRowMatch

public void setRowMatch(RowMatch rowMatch)
Description copied from interface: ViewObject
Sets an in-memory filter (RowMatch) for the view object. While the where-clause is used when a database query is issued, the row match is used for qualifying rows in memory. Calling this method does not cause filtering of rows by the row match. To filter, RowSet.executeQuery() must be called.
Specified by:
setRowMatch in interface ViewObject
Parameters:
rowMatch - the new row match.

getRowMatch

public RowMatch getRowMatch()
Description copied from interface: ViewObject
Gets the in-memory filter (RowMatch) for the view object. While the where-clause is used when a database query is issued, the row match is used for qualifying rows in memory.
Specified by:
getRowMatch in interface ViewObject
Returns:
the current row match.

setSortBy

public void setSortBy(java.lang.String sortBy)
Description copied from interface: ViewObject
Specify a clause to perform in-memory sorting. The string is parsed and the collection of rows is ordered by the in-memory parser.
Specified by:
setSortBy in interface ViewObject
Parameters:
sortBy - in-memory sort clause

getSortBy

public java.lang.String getSortBy()
Specified by:
getSortBy in interface ViewObject
Returns:
in-memory sort clause. See ViewObject.setSortBy(String)

setQueryMode

public void setQueryMode(int queryMode)
Description copied from interface: ViewObject
Sets query mode for the view object. Query mode controls how qualifying rows are formulated for each row set in the view object.

The queryMode parameter may be an OR'ed flag of QUERY_MODE_SCAN_... constants. See these constants for further details.

Calling this method does not cause automatically cause the new query mode to go into effect. Call RowSet.executeQuery() to apply the new query mode.

The default query mode is QUERY_MODE_SCAN_DATABASE_TABLES.

Specified by:
setQueryMode in interface ViewObject
Parameters:
queryMode - the new query mode.

addQueryMode

public void addQueryMode(int queryMode)
Description copied from interface: ViewObject
Adds query mode for the view object. Query mode controls how qualifying rows are formulated for each row set in the view object.

The queryMode parameter may be an OR'ed flag of QUERY_MODE_SCAN_... constants. This method OR'es in the incoming queryMode to the view object's current query mode. See these constants for further details.

Calling this method does not cause automatically cause the new query mode to go into effect. Call RowSet.executeQuery() to apply the new query mode.

Specified by:
addQueryMode in interface ViewObject
Parameters:
queryMode - the new query mode to be added (OR'ed).

getQueryMode

public int getQueryMode()
Description copied from interface: ViewObject
Gets the current query mode of this view object. Query mode controls how qualifying rows are formulated for each row set in the view object.

The returning value may be an OR'ed flag of QUERY_MODE_SCAN_... constants. See these constants for further details.

The default query mode is QUERY_MODE_SCAN_DATABASE_TABLES.

Specified by:
getQueryMode in interface ViewObject
Returns:
query mode.

refreshProperties

public java.util.Hashtable refreshProperties()
Overrides:
refreshProperties in class PropertiesHelper

getProperties

public java.util.Hashtable getProperties()
Description copied from interface: Properties
Gets the table of properties.
Specified by:
getProperties in interface Properties
Overrides:
getProperties in class PropertiesHelper
Returns:
a hashtable of properties.

setProperty

public void setProperty(java.lang.String hintName,
                        java.lang.Object hintValue)
Overrides:
setProperty in class PropertiesHelper

refreshProperty

public java.lang.Object refreshProperty(java.lang.String hintName)
Description copied from interface: Properties
Retrieves the specified property, if it exists. If the application running in a 3 tier environment, it retrieves the property from the middle-tier server, refreshing the value on the client side. If the application is running in a 2 tier environment, it is equivalent to getProperty.
Specified by:
refreshProperty in interface Properties
Overrides:
refreshProperty in class PropertiesHelper
Parameters:
hintName - Property name.
Returns:
the value of the property, if any, otherwise null.

isDefaultRowSet

public boolean isDefaultRowSet()
Internal: Applications should not use this method.
Specified by:
isDefaultRowSet in interface RowSet
Returns:
true always for View Object.

isExecuted

public boolean isExecuted()
Description copied from interface: RowSet
Returns true if the current ViewObject's query has been executed for this row set.
Specified by:
isExecuted in interface RowSet
Returns:
true if query has been executed.

executeQuery

public void executeQuery()
Description copied from interface: RowSet
Executes the query.
Specified by:
executeQuery in interface RowSet

executeEmptyRowSet

public void executeEmptyRowSet()
Specified by:
executeEmptyRowSet in interface RowSet

getViewLinkNames

public java.lang.String[] getViewLinkNames()
Description copied from interface: ViewObject
Constructs an array of names of view links that involve this view object.

A view link may use this view object as either its source or destination. This method should not be overridden.

Specified by:
getViewLinkNames in interface ViewObject
Returns:
the array of view link names.

clearCache

public void clearCache()
Description copied from interface: ViewObject
Clears the view object cache. This method can be called for resource conservation. Calling this method marks the view object and all its row sets as "needing to refresh its data". If another method that requires the result set is called (e.g., executeQuery(), next(), previous()) after this method, the query will be executed and the view object/row set's cache refreshed from the database.
Specified by:
clearCache in interface ViewObject

getRowSet

public RowSet getRowSet()
Description copied from interface: RowSetIterator
Gets the Row Set that this Iterator belongs to.
Specified by:
getRowSet in interface RowSetIterator
Returns:
the owning Row Set.

getRowSetIterator

public RowSetIterator getRowSetIterator()

next

public Row next()
Description copied from interface: RowIterator
Gets the next row in the iterator. If next() is called on an iterator whose Row Set has not yet been RowSet.executeQuery()'ed, the Row Set's query is executed. Thus, the user does not need to call executeQuery() himself before calling next(). We refer to this as implicit query execution or implicit Row Set execution.

Before moving to the next row, next() validates the current row (if the iterator has a current row) through a call to Row.validate().

If the currency is on the last row of the range and next() is called, the range is scolled down by one row to bring the next row into the visible range. In particular, if the range size is 1, next() scrolls the range down by 1 row.

When this method is called, the current row of the iterator may be outside the range. (Note that the current row does not have to be within the range.) If so, next() will scroll the range, so that the row that will be the current row at the conclusion of this method will be positioned in the middle of the range.

If the iterator is just opened or reset (see RowIterator.reset()), next() will return the first row if one exists. In this situation, next() is functionally equivalent to RowIterator.first().

If the iterator is at the last row of the Row Set, next() push the currency into the imaginary slot after the last row. This will set the current slot status to SLOT_BEYOND_LAST.

When the next row is required, a check is made to see if the row has already been brought into the collection. If not, the row is fetched from database. Note that the View Object's fetch mode affects how rows are fetched from database into the collection. See ViewObjectImpl.getFetchMode() for details.

If successful, this method designates the next row as the current row (the currency finally moves).

This method generates events to notify the changes to the iterator. If scrolling occurs because of conditions described above, a ScrollEvent will be sent to RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the RowSetListener interface. Further, this listener must be registered through a call to NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

If the currency is changed, it generates a NavigationEvent and sends it to RowSetListener.navigated(oracle.jbo.NavigationEvent).

Specified by:
next in interface RowIterator
Returns:
the next Row object, or null if there is no next row.

previous

public Row previous()
Description copied from interface: RowIterator
Gets the previous row in the iterator. If previous() is called on an iterator whose Row Set has not yet been RowSet.executeQuery()'ed, the Row Set's query is executed. Thus, the user does not need to call executeQuery() himself before calling previous(). We refer to this as implicit query execution or implicit Row Set execution.

Before moving to the previous row, previous() validates the current row (if the iterator has a current row) through a call to Row.validate().

If the currency is on the first row of the range and previous() is called, the range is scolled up by one row to bring the previous row into the visible range. In particular, if the range size is 1, previous() scrolls the range up by 1 row.

When this method is called, the current row of the iterator may be outside the range. (Note that the current row does not have to be within the range.) If so, previous() will scroll the range, so that the row that will be the current row at the conclusion of this method will be positioned in the middle of the range.

If the iterator is just opened or reset (see RowIterator.reset()), previous() will null as the currency is already on the imaginary slot before the first row.

If the iterator is at the first row of the Row Set, previous() push the currency into the imaginary slot before the first row. This will set the current slot status to SLOT_BEFORE_FIRST.

If successful, this method designates the previous row as the current row (the currency finally moves).

This method generates events to notify the changes to the iterator. If scrolling occurs because of conditions described above, a ScrollEvent will be sent to RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the RowSetListener interface. Further, this listener must be registered through a call to NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

If the currency is changed, it generates a NavigationEvent and sends it to RowSetListener.navigated(oracle.jbo.NavigationEvent).

Specified by:
previous in interface RowIterator
Returns:
the previous Row object, or null if there is no previous row.

first

public Row first()
Description copied from interface: RowIterator
Gets the first row in the iterator. If first() is called on an iterator whose Row Set has not yet been RowSet.executeQuery()'ed, the Row Set's query is executed. Thus, the user does not need to call executeQuery() himself before calling first(). We refer to this as implicit query execution or implicit Row Set execution.

This method checks to see if the currency is not on the first row. If not, it resets the currency to the imaginary slot before the first row and then calls RowIterator.next(). Note that the act of resetting the currency may cause the range to scroll upward.

If the currency is on the slot before the first row, it simply calls next(). In this case, first() is equivalent to next().

If the currency is already on the first row, nothing happens.

If first() is called on an empty Row Set (a Row Set that has no row), the currency is set to the slot after the last row, and null is returned.

This method generates events to notify the changes to the iterator, e.g., ScrollEvent and/or NavigationEvent. See RowIterator.next() for details.

Specified by:
first in interface RowIterator
Returns:
the first Row object, or null if there is no first row. In that case (null return), the current slot status will be RowIterator.SLOT_BEYOND_LAST.

last

public Row last()
Description copied from interface: RowIterator
Gets the last row in the iterator. If last() is called on an iterator whose Row Set has not yet been RowSet.executeQuery()'ed, the Row Set's query is executed. Thus, the user does not need to call executeQuery() himself before calling last(). We refer to this as implicit query execution or implicit Row Set execution.

Before moving to the last row, last() validates the current row (if the iterator has a current row) through a call to Row.validate().

This method retrieves all rows from the Row Set and scrolls (if necessary) to the last row. If some of these rows have not yet been fetched from database, it fetches them. The View Object's fetch mode affects how rows are fetched from database into the collection. See ViewObjectImpl.getFetchMode() for details.

If successful, this method designates the last row as the current row.

If last() is called on an empty Row Set, the currency moves to the slot beyond the last row. The current slot status is set to RowIterator.SLOT_BEYOND_LAST.

The caller of this method should be aware that it may take a long time to complete as all rows from the Row Set are fetched.

The number of rows in the range at the completion of this method is affected by the "iteration mode". See Iteration Modes above for details.

This method generates events to notify the changes to the iterator. If scrolling occurs because of conditions described above, a ScrollEvent will be sent to RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the RowSetListener interface. Further, this listener must be registered through a call to NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

If the currency is changed, it generates a NavigationEvent and sends it to RowSetListener.navigated(oracle.jbo.NavigationEvent).

Specified by:
last in interface RowIterator
Returns:
the last Row object, or null if there is no last row.

reset

public void reset()
Description copied from interface: RowIterator
Moves the currency to the slot before the first row.

After this method, the current slot status will be RowIterator.SLOT_BEFORE_FIRST except in cases where this iterator is associated to an iterator binding in an ADF application which sets the currency to the first row in the iterator if available. A subsequent invocation of RowIterator.next() will cause the first row to become the current row.

It sends a ScrollEvent to RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent) if the currency was not on the first row or on the slot before the first row. To pick up such an event, the listener object must implement the RowSetListener interface. Further, this listener must be registered through a call to NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

Specified by:
reset in interface RowIterator

hasNext

public boolean hasNext()
Description copied from interface: RowIterator
Tests for the existence of a row after the current row.
Specified by:
hasNext in interface RowIterator
Returns:
true if there is a next row. Specifically, if the Row Set is empty or if the currency is on the last row or the slot after the last row (current slot status == RowIterator.SLOT_BEYOND_LAST), it returns false. Otherwise, true.

hasPrevious

public boolean hasPrevious()
Description copied from interface: RowIterator
Tests for the existence of a row before the current row.

If the Row Set is forward-only, it returns false.

Specified by:
hasPrevious in interface RowIterator
Returns:
true if there is a previous row. Specifically, if the Row Set is empty or forward-only or if the currency is on the first row or the slot before the first row (current slot status == RowIterator.SLOT_BEFORE_FIRST), it returns false. Otherwise, true.

isRangeAtBottom

public boolean isRangeAtBottom()
Description copied from interface: RowIterator
Tests if the Row Set Iterator 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()
Description copied from interface: RowIterator
Tests if the Row Set Iterator 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.

getFetchedRowCount

public int getFetchedRowCount()
Description copied from interface: RowIterator
Counts the number of rows fetched from database into the Row Set collection up to this point.
Specified by:
getFetchedRowCount in interface RowIterator
Returns:
the number of rows fetched.

getRowCount

public int getRowCount()
Description copied from interface: RowIterator
Counts the total number of rows in the Row Set.

Note that this method retrieves all rows from the database then returns the number of rows in the Row Set collection.

Specified by:
getRowCount in interface RowIterator
Returns:
the number of rows.

getEstimatedRowCount

public long getEstimatedRowCount()
Description copied from interface: RowSet
Counts the number of rows in the collection defined by the view object's query.

This method uses a "SELECT COUNT(1) FROM (<query-statement>)" query to obtained the initial count. After that, changes to row count (such as insertion and deletion of rows) is kept up to date.

However, since the row counting query and the query to retrieve actual rows are issued at two different times, it is possible for the accurate count to change between these two points. This is why this method is named getEstimatedRowCount().

Specified by:
getEstimatedRowCount in interface RowSet
Returns:
an estimated number of rows.

getDeferredEstimatedRowCount

public long getDeferredEstimatedRowCount()
Description copied from interface: RowSet
If this ViewObject is marked to not perform the estimatedRowCount query, then return -1 until either the estimatedRowCount is called and the count is known or the RowSet is fetched completely in which case the actual row count is known.
Specified by:
getDeferredEstimatedRowCount in interface RowSet
Returns:
-1 until either EstimatedRowCount or real RowCount is known.

getCappedRowCount

public long getCappedRowCount(long cap)
Specified by:
getCappedRowCount in interface RowSet

getRowFilterValues

public java.lang.Object[] getRowFilterValues()
Specified by:
getRowFilterValues in interface WSRowSetIteratorMarshaller

setRowFilterValues

public void setRowFilterValues(java.lang.Object[] rowFilterValues)
Specified by:
setRowFilterValues in interface WSRowSetIteratorMarshaller

getCliIteratorState

public SvcMsgIteratorState getCliIteratorState()
Specified by:
getCliIteratorState in interface WSRowSetIteratorMarshaller

prepareForBatchMode

public void prepareForBatchMode(SvcMsgIteratorState iteratorState,
                                boolean setCurrentRow)
Specified by:
prepareForBatchMode in interface WSRowSetIteratorMarshaller

setRangeSize

public int setRangeSize(int size)
Description copied from interface: RowIterator
Modifies the size of the Row Set Iterator range.

This method takes effect when the next set of data is fetched. For an example usage of setRangeSize, see setRangeStart.

Specified by:
setRangeSize in interface RowIterator
Parameters:
size - the new number of rows in the iterator range. Size of 0 is treated same as 1. Size < -1 is treated same as -1.
Returns:
the new size of the range.
See Also:
RowIterator.setRangeStart(int)

getRangeSize

public int getRangeSize()
Description copied from interface: RowIterator
Gets the size of the Row Set Iterator range.
Specified by:
getRangeSize in interface RowIterator
Returns:
the number of rows in the range.

getRangeStart

public int getRangeStart()
Description copied from interface: RowIterator
Gets the absolute row index of the first row in the Row Set Iterator 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)
Description copied from interface: RowIterator
Moves the Row Set Iterator 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 Iterator range.

scrollRange

public int scrollRange(int amount)
Description copied from interface: RowIterator
Moves the Row Set Iterator 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.

getEstimatedRangePageCount

public int getEstimatedRangePageCount()
Description copied from interface: RowSetIterator
Returns getEstimatedRowCount()/rangePageSize, if rangeSize > 0. For rangeSize <= 0, returns 1.

This number may fluxuate when the View Object is syncronized with its Entity Object.

Specified by:
getEstimatedRangePageCount in interface RowSetIterator
Returns:
the number of range-pages that this RowSet collection has.

scrollToRangePage

public int scrollToRangePage(int pageIndex)
Description copied from interface: RowSetIterator
Moves the row set range start to the given page index where every page consists of RangeSize number of rows. PageIndex should start at page number 1. This method calculates the rowIndex that should start at that page and then scrolls the iterator to start at that row by using the following calculation:

(rangeSize * (pageSize-1)) - getRangeStart();

Specified by:
scrollToRangePage in interface RowSetIterator
Parameters:
pageIndex - the page number to go to in the result set.
Returns:
the number of rows actually scrolled.

scrollRangeTo

public int scrollRangeTo(Row row,
                         int index)
Description copied from interface: RowIterator
Scrolls the range to place a given row at a given range index.
Specified by:
scrollRangeTo in interface RowIterator
Parameters:
row - the row.
index - the range index at which the row is to be found.
Returns:
the actual number of rows scrolled. A negative number indicates that the scroll was scrolled upward.

getRow

public Row getRow(Key key)
Description copied from interface: RowIterator
Locates and returns a row by its unique key.

If the key being passed in has the row handle, it uses the row handle to locate the row. This is a quick operation. (A key returned from a call to Row.getKey() contains the row handle.)

If the key does not have a row handle, or if the handle look up did not find the row in the View row cache, it performs a linear search through the Row Set collection looking for a match. Hence, this method could take quite a long time to complete.

This method is similar to RowIterator.findByKey(Key, int) in that both methods return Row(s) that match the given key. However, the user should understand the differences. First, findByKey() performs random search. getKey() only performs random search if the key has the row handle portion and if the row with that handle is currently in the Row Set collection. Otherwise, getKey() does a linear search. Hence, findByKey() is generally faster.

However, findByKey() may find the matching Row(s) out of sequence. When a row is not found in the View row cache, findByKey() issues a database query. Matching rows are retrieved and appended to the Row Set collection. For example, suppose the Row Set collection has 200 rows that qualify in the database. Suppose the user retrieved only 10 rows (190 not yet retrieved). Suppose, at this time, the user issues findByKey() that locates the 200-th row (the last row in database result set). That row is appended to the Row Set collection at the 11-th spot. Thus, when you use findByKey(), you may see rows out of sequence. In contrast, getRow() always retrieves rows in sequence.

If the Row Set collection is of any non-trivial size (say over 50), we would recommend findByKey().

findByKey() allows for partial key (only for View Objects that have multiple Entity bases). When a partial key is specified, multiple rows may return. getKey() returns one and only one row (exact match).

Specified by:
getRow in interface RowIterator
Parameters:
key - the key.
Returns:
the Row object matching the key.

getRowAtRangeIndex

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

getCurrentRow

public Row getCurrentRow()
Description copied from interface: RowIterator
Accesses the current row.
Specified by:
getCurrentRow in interface RowIterator
Returns:
the Row object designated as the current row.

getCurrentRowIndex

public int getCurrentRowIndex()
Description copied from interface: RowIterator
Gets the absolute index (not range index) of the current row.
Specified by:
getCurrentRowIndex in interface RowIterator
Returns:
a row index.

getCurrentRowSlot

public int getCurrentRowSlot()
Description copied from interface: RowIterator
Gets the slot status of the current row.
Specified by:
getCurrentRowSlot in interface RowIterator
Returns:
one of the class constants prefixed by SLOT_.

getIterMode

public int getIterMode()
Description copied from interface: RowIterator
Gets the current iteration mode. See Iteration Modes above for details on iteration mode which controls how the range behaves when it reaches the end of the Row Set.
Specified by:
getIterMode in interface RowIterator
Returns:
ITER_MODE_LAST_PAGE_PARTIAL if the iteration mode is "partial-last-page", ITER_MODE_LAST_PAGE_FULL if it is "full-last-page".

setIterMode

public void setIterMode(int mode)
Description copied from interface: RowIterator
Sets the iteration mode for this Row Iterator. See Iteration Modes above for details on iteration mode which controls how the range behaves when it reaches the end of the Row Set.
Specified by:
setIterMode in interface RowIterator
Parameters:
mode - should be ITER_MODE_LAST_PAGE_PARTIAL if the iteration mode is to be "partial-last-page", ITER_MODE_LAST_PAGE_FULL if it is to be "full-last-page".

isRowValidation

public boolean isRowValidation()
Description copied from interface: RowIterator
Gets the validation flag on this iterator. By default a RowIterator validates the current row when navigating to another row. This method returns TRUE if this row-validation is turned off.
Specified by:
isRowValidation in interface RowIterator

setRowValidation

public void setRowValidation(boolean flag)
Description copied from interface: RowIterator
Sets the validation flag on this iterator. By default a RowIterator validates the current row when navigating to another row. This method can be used to turn this row-validation off by passing 'false' as parameter.
Specified by:
setRowValidation in interface RowIterator
Parameters:
flag - Whether to turn row validation off or not.

setCurrentRow

public boolean setCurrentRow(Row row)
Description copied from interface: RowIterator
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.

setCurrentRowAtRangeIndex

public boolean setCurrentRowAtRangeIndex(int index)
Description copied from interface: RowIterator
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.

createAndInitRow

public Row createAndInitRow(AttributeList nvp)
Description copied from interface: RowIterator
Creates and initializes a new Row object, but does not insert it into the Row Set. This method differs from createRow() mainly in that this method allows the user to pass in a list of name-value pairs with which row attributes are initialized.

nvp is a named value pair. When building an nvp from scratch, use NameValuePairs to build a new nvp. Here is an example:

    NameValuePairs nvp = new NameValuePairs();
    nvp.setAttribute("EmpTyp", "C");

    Row row = voEmp.createAndInitRow(nvp);
 
This method is particularly useful when creating a subclass View Row or Entity Row. You can include polymorphic discriminator attribute values in nvp and correct subclass row object will be created.

When this method is called, underlying entities are created. After the new entities are created, a new view row is created. After that ViewRowImpl.create(oracle.jbo.AttributeList) is called with this nvp. ViewRowImpl.create(AttributeList) walks thru the list of entities and calls EntityImpl.create(AttributeList) with the same nvp for each entity in the view row.

Specified by:
createAndInitRow in interface RowIterator
Parameters:
nvp - a list of name-value pairs.
Returns:
a new Row object.

createRow

public Row createRow()
Description copied from interface: RowIterator
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)
Description copied from interface: RowIterator
Inserts 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.

insertRowAtRangeIndex

public void insertRowAtRangeIndex(int index,
                                  Row row)
Description copied from interface: RowIterator
Inserts a row to the Row Set at the given range 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.

removeCurrentRow

public void removeCurrentRow()
Description copied from interface: RowIterator
Removes the current Row object from the Row Set.
Specified by:
removeCurrentRow in interface RowIterator

removeCurrentRowFromCollection

public void removeCurrentRowFromCollection()
Description copied from interface: RowIterator
Removes the current Row object from the collection.

It does not cause the row to be deleted from the database table. It just removes the row from the row collection. However, once the row is removed, it cannot be used any more. If you want to remove the current row from collection and insert it elsewhere, call RowIterator.removeCurrentRowAndRetain(), change currency to the desired location, and then call RowIterator.insertRow(oracle.jbo.Row) with that row.

Specified by:
removeCurrentRowFromCollection in interface RowIterator

removeCurrentRowAndRetain

public Row removeCurrentRowAndRetain()
Description copied from interface: RowIterator
Removes the current Row object from the collection and retain it for insertion into another location.

It does not cause the row to be deleted from the database table. It just removes the row from the row collection.

This method differs from RowIterator.removeCurrentRowFromCollection() in that after the current row is removed from the collection, it can be inserted back into the collection at another location.

To do so, call RowIterator.removeCurrentRowAndRetain(), and get the returning row. Then, change currency to the desired location, and call RowIterator.insertRow(oracle.jbo.Row) with that row.

Specified by:
removeCurrentRowAndRetain in interface RowIterator
Returns:
the current row which was just removed from collection.

getRangeIndexOf

public int getRangeIndexOf(Row row)
Description copied from interface: RowIterator
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 index of row,

enumerateRowsInRange

public java.util.Enumeration enumerateRowsInRange()
Description copied from interface: RowIterator
Gets an Enumeration of all rows in the Row Set.
Specified by:
enumerateRowsInRange in interface RowIterator
Returns:
an Enumeration interface.

getFilteredRows

public Row[] getFilteredRows(java.lang.String attrName,
                             java.lang.Object attrValue)
Description copied from interface: RowSetIterator
Returns all rows in this collection whose attribute value matches the value being passed in attrValue.

Note that this method does not affect the current RowSetIterator.

Specified by:
getFilteredRows in interface RowSetIterator
Parameters:
attrName - name of the attribute to be used for filtering.
attrValue - attribute value for filtering.
Returns:
an array of rows that match.

getFilteredRowsInRange

public Row[] getFilteredRowsInRange(java.lang.String attrName,
                                    java.lang.Object attrValue)
Description copied from interface: RowSetIterator
Returns all rows in this range whose attribute value matches the value being passed in attrValue.

This method uses getAllRowsInRange() to retrieve all rows and then match the rows.

Specified by:
getFilteredRowsInRange in interface RowSetIterator
Parameters:
attrName - name of the attribute to be used for filtering.
attrValue - attribute value for filtering.
Returns:
an array of rows in the current range that match.

getAllRowsInRange

public Row[] getAllRowsInRange()
Description copied from interface: RowIterator
Extracts the rows in the range.
Specified by:
getAllRowsInRange in interface RowIterator
Returns:
an array of Row objects. The size if the array is setViewSize().

getNextRangeSet

public Row[] getNextRangeSet()
Description copied from interface: RowSetIterator
Gets the next set of rows in the range. This method is good for processing rows in a range-ful fashion. Suppose the Row Set has 20 rows and the Iterator range size is 10. Suppose further that the Iterator is showing rows 0 through 9 (0-based indexing). Calling getNextRangeSet() will return rows 10 through 19.

If the next range set does not have enough rows to fill up the range, getNextRangeSet() returns a partially filled range. That is, this method operates as if the iteration mode is RowIterator.ITER_MODE_LAST_PAGE_PARTIAL.

If there is no more rows, this method returns an empty array (an array of length 0).

While obtaining the next range set, the range will be scrolled. This causes a ScrollEvent to be sent to RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the RowSetListener interface. Further, this listener must be registered through a call to NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

After the next range set is obtained, the method sets the first Row of the range as the current row. This may fire a NavigationEvent and sends it to RowSetListener.navigated(oracle.jbo.NavigationEvent).

Specified by:
getNextRangeSet in interface RowSetIterator
Returns:
an array of Rows in the next range set. An array of length 0 if there are no more rows.

getPreviousRangeSet

public Row[] getPreviousRangeSet()
Description copied from interface: RowSetIterator
Gets the previous set of rows in the range. This method is good for processing rows in a range-ful fashion. Suppose the Row Set has 20 rows and the Iterator range size is 10. Suppose further that the Iterator is showing rows 10 through 19 (0-based indexing). Calling getPreviousRangeSet() will return rows 0 through 9.

If there is no more rows, this method returns an empty array (an array of length 0).

While obtaining the previous range set, the range will be scrolled. This causes a ScrollEvent to be sent to RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the RowSetListener interface. Further, this listener must be registered through a call to NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

After the previous range set is obtained, the method sets the first Row of the range as the current row. This may fire a NavigationEvent and sends it to RowSetListener.navigated(oracle.jbo.NavigationEvent).

Specified by:
getPreviousRangeSet in interface RowSetIterator
Returns:
an array of Rows in the previous range set. An array of length 0 if there are no more rows.

getViewObject

public ViewObject getViewObject()
Description copied from interface: RowSet
Gets the view object that owns this row set.

If this row set is the result of calling a view link accessor, the returned view object is an internal view object. ViewObject.isInternal() indicates whether the view object is internal or not. Even if a view link is defined between the master and detail view object, and even if an instance of them are included in the application module's data model, calling the view link by default uses a separate view object instance from the one in the AM's data model. To access the view link accessor's ViewObject, use the following code snippet (assuming that the detail side is called "MyDetail"):

    RowSet detailRS = (RowSet) masterViewRow.getMyDetail();
    ViewObject detailVO = detailRS.getViewObject();
 
Specified by:
getViewObject in interface RowSet
Returns:
the parent view object.

setMasterRowSetIterator

public boolean setMasterRowSetIterator(RowSetIterator masterRS)
Description copied from interface: RowSet
Sets the master iterator.
Specified by:
setMasterRowSetIterator in interface RowSet
Parameters:
masterRS - the new master row set iterator for this row set.
Returns:
true if the operation succeeded.

removeMasterRowSetIterator

public boolean removeMasterRowSetIterator(RowSetIterator masterRS)
Description copied from interface: RowSet
Removes a master row set iterator.
Specified by:
removeMasterRowSetIterator in interface RowSet
Parameters:
masterRS - the iterator to be removed.
Returns:
true if masterRS was found, false otherwise.

getMasterRowSetIterators

public RowSetIterator[] getMasterRowSetIterators()
Description copied from interface: RowSet
Return all controlling masters of this row set.
Specified by:
getMasterRowSetIterators in interface RowSet
Returns:
An array of master iterators.

addDynamicAttribute

public AttributeDef addDynamicAttribute(java.lang.String attrName)
Description copied from interface: ViewObject
Adds a dynamic attribute (an AttributeDefImpl) to this view object's row set.

Dynamic attributes are typeless, in that the application can set the attribute value to any object. You can use a dynamic attribute to store information created at runtime that you want to store with the row data. It is used only by the view object that created it. Attributes can be any serializable (java.io.Serializable) object.

This method should not be overridden.

Specified by:
addDynamicAttribute in interface ViewObject
Parameters:
attrName - the name of the dynamic attribute.
Returns:
the attribute definition the newly added dynamic attribute.

addDynamicAttributeWithType

public AttributeDef addDynamicAttributeWithType(java.lang.String attrName,
                                                java.lang.String javaTypeName,
                                                java.lang.String transientExpression)
Specified by:
addDynamicAttributeWithType in interface ViewObject

getParent

public java.lang.Object getParent()
Specified by:
getParent in interface ClientComponentObject

getApplicationModule

public ApplicationModule getApplicationModule()
Description copied from interface: RowSet
Gets the row set's application module that contains this row set.

Strictly speaking, a row set belongs to a view object and the view object to an application module. This method returns the application module that cotains the view object, which contains this row set.

If this row set is the result of calling a View Link accessor, this row set belongs to an internal view object (see ViewObject.isInternal()). Such an internal view object belongs to the root application module. Put differently, if you call this method on a row set which is the result of calling a View Link accessor, it will return the root application module.

Specified by:
getApplicationModule in interface RowSet
Returns:
the ApplicationModule to which this row set belongs.

addListener

public void addListener(java.lang.Object target)
Description copied from interface: NavigatableRowIterator
Adds a subscriber (listener) to be notified of RowSetListener events generated by this row set iterator.
Specified by:
addListener in interface NavigatableRowIterator
Parameters:
target - the subscriber to be added. It should implement RowSetListener.

addInternalListener

public void addInternalListener(java.lang.Object target)
Specified by:
addInternalListener in interface InternalListenerManager

removeInternalListener

public void removeInternalListener(java.lang.Object target)
Specified by:
removeInternalListener in interface InternalListenerManager

removeListener

public void removeListener(java.lang.Object target)
Description copied from interface: NavigatableRowIterator
Removes a subscriber (listener) for RowSetListener events generated by this row set iterator.
Specified by:
removeListener in interface NavigatableRowIterator
Parameters:
target - the subscriber to be removed.

addManagementListener

public void addManagementListener(RowSetManagementListener target)
Description copied from interface: RowSetIterator
Adds a subscriber (listener) to be notified of RowSetManagementListener events generated by this Row Set Iterator.
Specified by:
addManagementListener in interface RowSetIterator
Parameters:
target - the subscriber to be added. It should implement RowSetManagementListener.

removeManagementListener

public void removeManagementListener(RowSetManagementListener target)
Description copied from interface: RowSetIterator
Removes a subscriber (listener) for RowSetManagementListener events generated by this row set iterator.
Specified by:
removeManagementListener in interface RowSetIterator
Parameters:
target - the subscriber to be removed.

rangeRefreshed

public void rangeRefreshed(RangeRefreshEvent event)
Description copied from interface: RowSetListener
Invoked when the range changes.
Specified by:
rangeRefreshed in interface RowSetListener
Parameters:
event - a description of the new ranges.

rangeScrolled

public void rangeScrolled(ScrollEvent event)
Description copied from interface: RowSetListener
Invoked when the range is scrolled.
Specified by:
rangeScrolled in interface RowSetListener
Parameters:
event - a description of the new range.

rowInserted

public void rowInserted(InsertEvent event)
Description copied from interface: RowSetListener
Invoked when a row has been inserted.
Specified by:
rowInserted in interface RowSetListener
Parameters:
event - a description of the new Row object.

rowDeleted

public void rowDeleted(DeleteEvent event)
Description copied from interface: RowSetListener
Invoked when a row has been deleted.
Specified by:
rowDeleted in interface RowSetListener
Parameters:
event - a description of the deleted Row object.

rowUpdated

public void rowUpdated(UpdateEvent event)
Description copied from interface: RowSetListener
Invoked when an attribute of the row has been changed.
Specified by:
rowUpdated in interface RowSetListener
Parameters:
event - a description of the modified Row object.

navigated

public void navigated(NavigationEvent event)
Description copied from interface: RowSetListener
Invoked when the current-row designation changes.
Specified by:
navigated in interface RowNavigationListener
Specified by:
navigated in interface RowSetListener
Parameters:
event - a description of the new and previous current rows.

createRowSet

public RowSet createRowSet(java.lang.String name)
Description copied from interface: ViewObject
Creates and returns a new (secondary) row set for this view object.
Specified by:
createRowSet in interface ViewObject
Parameters:
name - the name for the new RowSet.
Returns:
the new row set.

closeRowSet

public void closeRowSet()
Description copied from interface: RowSet
Closes the row set. It closes all row set iterators that belong to this row set. If this row set is a detail row set in a master-detail relationship, closeRowSet removes this row set from the master row set iterator.
Specified by:
closeRowSet in interface RowSet

closeRowSetIterator

public void closeRowSetIterator()
Description copied from interface: RowSetIterator
Closes this row set iterator. If this row set iterator is a master in a master-detail relationship, closeRowSetIterator closes all detail row sets.

After that, it fires a RowSetManagementListener.iteratorClosed() event to its RowSetManagementListener's.

Then, it deregisters this row set iterator from the owning row set, and deregisters all its listeners.

Specified by:
closeRowSetIterator in interface RowSetIterator

getRowSets

public RowSet[] getRowSets()
Get all Row Sets that belong to this View Object.
Specified by:
getRowSets in interface ViewObject
Returns:
the array of Row Sets.

findRowSet

public RowSet findRowSet(java.lang.String name)
Description copied from interface: ViewObject
Gets the named row set that was created at runtime for this view object.
Specified by:
findRowSet in interface ViewObject
Parameters:
name - a row set name. If null, it returns the the view object.
Returns:
the row set. null if the named row set is not not found.

createRowSetIterator

public RowSetIterator createRowSetIterator(java.lang.String name)
Description copied from interface: RowSet
Creates an iterator for the row set.
Specified by:
createRowSetIterator in interface RowSet
Parameters:
name - the name to be given to the iterator.
Returns:
an iterator for this.

getRowSetIterators

public RowSetIterator[] getRowSetIterators()
Description copied from interface: RowSet
Gets all row set iterators that belong to this row set.
Specified by:
getRowSetIterators in interface RowSet
Returns:
the array of row set iterators.

findRowSetIterator

public RowSetIterator findRowSetIterator(java.lang.String name)
Description copied from interface: RowSet
Gets the named row set iterator that was created at runtime for this row set.
Specified by:
findRowSetIterator in interface RowSet
Parameters:
name - a row set iterator name. If null, it returns the the row set.
Returns:
the row set iterator. null if the named row set iterator is not not found.

getRowCountInRange

public int getRowCountInRange()
Description copied from interface: RowIterator
Gets the size of the Row Set Iterator range.
Specified by:
getRowCountInRange in interface RowIterator
Returns:
the number of rows in the range.

isReadOnly

public boolean isReadOnly()
Description copied from interface: ViewObject
Tests if the view object is read-only.

A view is read-only if it does not have primary keys or if all its entity references are reference-only.

This method should not be overridden.

Specified by:
isReadOnly in interface ViewObject
Overrides:
isReadOnly in class PropertiesHelper
Returns:
true if this view object is read-only; false if it is updateable.

addViewLink

protected void addViewLink(ViewLink viewLink)

removeViewLink

protected void removeViewLink(ViewLinkImpl viewLink)

getViewLinks

protected ViewLink[] getViewLinks()
Returns:
List of ViewLinkImpl's

getDetailRowSets

public RowSet[] getDetailRowSets()
Get all detail Row Sets for this View Object.
Specified by:
getDetailRowSets in interface RowSetIterator
Returns:
the array of detail Row Sets.

createDetailRowSet

public RowSet createDetailRowSet(java.lang.String voName,
                                 java.lang.String linkDefName)
Create a row set for the view link.
Specified by:
createDetailRowSet in interface RowSetIterator
Parameters:
voName - the name of the new detail Row Set.
linkDefName - the name of a View Link definition. This View Link chooses the relationship in which this Iterator is the master and the new Row Set is the detail. It must be a fully qualified name (including the package name).
Returns:
the detail RowSet object.

getViewCriteriaManager

public ViewCriteriaManager getViewCriteriaManager()
Specified by:
getViewCriteriaManager in interface ViewObject
Returns:
A criteria manager to hold all view criteria for the view object and manage applied and unapplied ones.

createViewCriteria

public ViewCriteria createViewCriteria()
View Criteria factory
Specified by:
createViewCriteria in interface ViewObject
Returns:
the new view criteria object.
See Also:
ViewCriteria, ViewObject.applyViewCriteria(ViewCriteria)

getViewCriteria

public ViewCriteria getViewCriteria(java.lang.String name)
Description copied from interface: ViewCriteriaManager
Returns a reference to the view criteria with a specific name if it is found.
Specified by:
getViewCriteria in interface ViewCriteriaManager
Parameters:
name - view criteria name
Returns:
a view criteria reference or null

getAllViewCriterias

public ViewCriteria[] getAllViewCriterias()
Description copied from interface: ViewCriteriaManager
Returns a list of both applied and unapplied view criterias managed by this object.
Specified by:
getAllViewCriterias in interface ViewCriteriaManager
Returns:
an array of view criteria

getAllViewCriteriaNames

public java.lang.String[] getAllViewCriteriaNames()
Description copied from interface: ViewCriteriaManager
Returns a list of both applied and unapplied view criterias managed by this object.
Specified by:
getAllViewCriteriaNames in interface ViewCriteriaManager
Returns:
an array of view criteria names

getAvailableViewCriteriaNames

public java.lang.String[] getAvailableViewCriteriaNames()
Description copied from interface: ViewCriteriaManager
Returns a list of view criteria names that are unapplied and managed by this object
Specified by:
getAvailableViewCriteriaNames in interface ViewCriteriaManager
Returns:
the names of the criteria that can still be applied

putViewCriteria

public void putViewCriteria(java.lang.String name,
                            ViewCriteria vc)
Description copied from interface: ViewCriteriaManager
Add a view criteria to be managed by this object
Specified by:
putViewCriteria in interface ViewCriteriaManager
Parameters:
name - Name of the view criteria
vc - view criteria reference

clearViewCriterias

public void clearViewCriterias()
Description copied from interface: ViewCriteriaManager
Clear all view criteria, both applied and unapplied help by this manager
Specified by:
clearViewCriterias in interface ViewCriteriaManager

removeViewCriteria

public ViewCriteria removeViewCriteria(java.lang.String name)
Description copied from interface: ViewCriteriaManager
Removes the view criteria from this manager. If it is applied it is first unapplied and then removed. If the intent is to simply unapply use removeApplyViewCriteriaName API.
Specified by:
removeViewCriteria in interface ViewCriteriaManager
Parameters:
name - The view criteria name that needs to be removed
Returns:
reference to the removed view criteria if found.

removeApplyViewCriteriaName

public boolean removeApplyViewCriteriaName(java.lang.String name)
Description copied from interface: ViewCriteriaManager
Unapplied the view criteria if it is applied. The view criteria will continue to be managed by this manager.
Specified by:
removeApplyViewCriteriaName in interface ViewCriteriaManager
Parameters:
name - The view criteria name that need to be unapplied.
Returns:
true if the view criteria was found to be applied, false otherwise.

getViewCriteria

public ViewCriteria getViewCriteria()
Gets the view criteria.
Specified by:
getViewCriteria in interface ViewCriteriaManager
Specified by:
getViewCriteria in interface ViewObject
Returns:
the view criteria, or null if none was applied.

applyViewCriteria

public void applyViewCriteria(ViewCriteria criteria)
Description copied from interface: ViewObject
Applies the view criteria to this view object. Invoking this method will erase all the previously applied view criteria on the view object.
Specified by:
applyViewCriteria in interface ViewCriteriaManager
Specified by:
applyViewCriteria in interface ViewObject
Parameters:
criteria - view criteria to be applied

applyViewCriteria

public void applyViewCriteria(ViewCriteria criteria,
                              boolean bAppend)
Description copied from interface: ViewObject
Applied the view criteria to this view object. If bAppend is true view criteria is appended to the list of already applied view criteria. If bAppend is false the applied view criteria list is cleared prior to applying the passed view criteria.
Specified by:
applyViewCriteria in interface ViewCriteriaManager
Specified by:
applyViewCriteria in interface ViewObject
Parameters:
criteria - view criteria to be applied
bAppend - flag to indicate if the applied view criteria list needs to be cleared before applying the view criteria.

setApplyViewCriteriaName

public void setApplyViewCriteriaName(java.lang.String name)
Description copied from interface: ViewCriteriaManager
Apply the view criteria name passed as the argument. The applied criteria name list will first be cleared out and then the view criteria passed as argument is applied. If null is passed as the argument there will be no applied view criteria.
Specified by:
setApplyViewCriteriaName in interface ViewCriteriaManager
Parameters:
name - the criteria to be applied.

setApplyViewCriteriaName

public void setApplyViewCriteriaName(java.lang.String name,
                                     boolean bAppend)
Description copied from interface: ViewCriteriaManager
Apply the view crtieria name passed as the argument. If bAppend is true the passed view criteria will be applied in addition to the existing ones. If bAppend is false this method is identical to ViewCriteriaManager.setApplyViewCriteriaName(String)
Specified by:
setApplyViewCriteriaName in interface ViewCriteriaManager
Parameters:
name - the criteria to be applied
bAppend - pass true if the view criteria needs to be appended to the applied list otherwise the list is cleared out.

setApplyViewCriteriaNames

public void setApplyViewCriteriaNames(java.lang.String[] names)
Description copied from interface: ViewCriteriaManager
Apply a set of view criteria names passed as the argument. The applied criteria name list will first be cleared out and then the view criterias passed as argument are applied.
Specified by:
setApplyViewCriteriaNames in interface ViewCriteriaManager
Parameters:
names - the criterias to be applied.

getApplyViewCriterias

public ViewCriteria[] getApplyViewCriterias(int criteriaMode)
Description copied from interface: ViewCriteriaManager
Return a list of applied view criteria that have the mode passed in the argument turned on. Refer to ViewCriteria.CRITERIA_MODE_CACHE and ViewCriteria.CRITERIA_MODE_QUERY for more information. View criterias that have both modes turned on are also qualified.
Specified by:
getApplyViewCriterias in interface ViewCriteriaManager
Parameters:
criteriaMode - the mode to match the criteria.
Returns:
An array of matching applied view criterias.

getApplyViewCriteriaNames

public java.lang.String[] getApplyViewCriteriaNames()
Specified by:
getApplyViewCriteriaNames in interface ViewCriteriaManager
Returns:
An array of view criteria names that are currently in the applied state.

setCurrentUnionViewCriteriaName

public void setCurrentUnionViewCriteriaName(java.lang.String vcName)
Specified by:
setCurrentUnionViewCriteriaName in interface ViewCriteriaManager

getViewCriteriaClause

public java.lang.String getViewCriteriaClause(boolean forQuery)
Description copied from interface: ViewCriteriaManager
This method is used by the framework to generate a query clause for the applied view criterias. If the argument is true the clause will be generated for a database query, if false the clause will be generated for in-memory filtering using an expression evaluator.
Specified by:
getViewCriteriaClause in interface ViewCriteriaManager
Parameters:
forQuery - true if the clause is needed for a database query, false for in-memory filtering.
Returns:
a clause for performing row filtering

buildViewCriteriaClauses

public CriteriaClauses buildViewCriteriaClauses(ViewCriteria vc)
Description copied from interface: ViewCriteriaManager
This method is used by the framework to generate a query clause for a particular view criteria. Used by ViewCriteriaManager.getViewCriteriaClause(boolean)
Specified by:
buildViewCriteriaClauses in interface ViewCriteriaManager
Parameters:
vc - the view criteria whose criteria needs to be generated
Returns:
a reference to an object that store clauses for both database and in-memory filtering

criteriaChanged

public void criteriaChanged(ViewCriteria vc)
Description copied from interface: ViewCriteriaManager
The criteria manager can track changes to applied view criteria. If the structure of an applied view criteria changes or a view criteria item in an applied view criteria has a new value then this method is invoked by the framework so that the manager can initiate a fresh clause generation when required.
Specified by:
criteriaChanged in interface ViewCriteriaManager
Parameters:
vc - the view criteria that has changed

resetCriteria

public void resetCriteria(ViewCriteria vc)
Description copied from interface: ViewCriteriaManager
Resets a view criteria to the state as defined in the View Definition.
Specified by:
resetCriteria in interface ViewCriteriaManager
Parameters:
vc - View Criteria to be reset

createKey

public Key createKey(AttributeList nvp)
Given a set of attribute values (name-value pairs), creates a key object for this ViewObject. This method could be used to create the input for the findByPrimaryKey method. If the key cannot be created, this method returns null.
Specified by:
createKey in interface RowIterator
Returns:
the key with ordered attribute list values according to this definition; null if the key cannot be created.

findByKey

public Row[] findByKey(Key key,
                       int maxNumOfRows)
Description copied from interface: RowIterator
Finds and returns View rows that match the specified key.

If this View Object has multiple Entity Object bases, the key need not be specified for all. However, if a key is specified for n-th Entity Object, and if this Entity Object's primary key consists of multiple parts, all parts of the key must be specified.

If not all Entity keys are included, multiple rows may match the partial key. The maxNumOfRows parameter is used to specify the maximum number of rows to return.

For example, suppose the View Object has Emp and DeptLocation as its Entity Object bases. Suppose further that Emp has a one part primary key (employee number) and DeptLocation has a two part primary key (dept name and location).

The user can make the following call to look for all employees working in ACCOUNTING's NEW YORK office:

    // The key will consist of 3 parts.  The first part is
    // for the employee number (which is null, meaning not
    // specified).  The second part is the department name.
    // The third is the location.
    Object [] keyValues = new Object[3];

    keyValues[0] = null;  // All employees
    keyValues[1] = "ACCOUNTING";
    keyValues[4] = "NEW YORK"; // third Entity Object, key part 1

    Row[] rows = myAM.findByKey(new Key(keyValues), -1);
 

In this example, if you were to include the key for DeptLocation, you must specify both key parts.

Note that the position of the key must patch the order of the Entity Object bases and their keys. In the above example, keyValues[0] is always the employee number. You cannot specify the employee number in keyValues[1] or keyValues[2].

This method works even on a View Object which has no Entity Object base. For this to work, however, the ViewObject's key attribute list must have been set up through a call to ViewObjectImpl.setKeyAttributeDefs(int[]). For example, suppose we have a View Object with 5 attributes where attribute 0 and 2 are to be its key attributes.

Then, the following code block will retrieve all rows whose attribute 0 is "PERM" and attribute 2 is 30.

    // First set up the key attributes
    myVO.setKeyAttributeDefs(new int[] { 0, 2 });

    // The key will consist of 2 parts.  The first part is
    // for attribtue 0 and the second is for attribute 2.
    Object [] keyValues = new Object[2];

    keyValues[0] = "PERM";
    keyValues[1] = new Integer(30);

    Row[] rows = myAM.findByKey(new Key(keyValues), -1);
 

Internally, findByKey() works as follows for a View Object with Entity Object bases: It takes the first non-null entity key from key. It uses it to find the Entity row in the cache. If it finds it, then it looks at all View rows in the Row Set collection that uses that Entity row and apply the remaining keys to qualify them. It may or may not find as many rows as requested.

If the requested number of rows have been found, the array returns. Otherwise, a check is made to see if the View Object's fetch size is unlimited (which is -1, see ViewObject.setMaxFetchSize(int)) and the Row Set has fetched all the rows out of database into its collection. If this is the case, we return the array even if the requested number of rows have not been found. This is because these conditions imply that all rows have been brought into Row Set collection and no further search is necessary.

Otherwise (the requested number of rows not yet found and the Row Set has not yet fetched all rows or the fetch size is not -1), the search continues. We now use the key build a where-clause for an internal View Object. That where-clause is applied and qualifying rows are retrieved from it to find the requested number of rows.

For a View Object which has no Entity Object base, we simply skip the step of looking in the Entity Object cache. Other than that, the logic is applied.

As new rows are retrieved from database they are added to the Row Set collection. Thus, the user can work with these rows immediately, e.g., call RowIterator.setCurrentRow(Row) with one of them. Care is applied to make sure the same row is not added to the Row Set collection multiple times.

This method does not fire any navigation event, nor does it move the range or the current row. Also, as rows are added to the Row Set collection, no insertion event fires (as this is analogous to fetching rows).

See RowIterator.getRow(Key) for comparison between this method and getRow(Key).

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:
an array of rows matching the key.

findByAltKey

public RowIterator findByAltKey(java.lang.String keyName,
                                Key key,
                                int maxNumOfRows,
                                boolean skipWhere)
Description copied from interface: RowIterator
Same as RowIterator.findByKey(Key, int) with a few extra functionalities. The key is for an alternate key. You can specifcy the alternate key name through the keyName parameter.

A skipWhere parameter controls whether or notthe current view object's where-clause is included in the db query if a db query is issued to get the row(s).

It returns a RowIterator and not a row array. You can enumerate through rows of this row iterator.

Specified by:
findByAltKey in interface RowIterator
Parameters:
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.
key - the alternate 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.
Returns:
an array of rows matching the alternate key.

findByViewCriteria

public RowIterator findByViewCriteria(ViewCriteria criteria,
                                      int maxNumOfRows,
                                      int queryMode)
Description copied from interface: RowIterator
Finds and returns View rows that match the specified View Criteria. See ViewCriteria for details on how to build and use a View Criteria.

The queryMode parameter controls the manner in which the qualifying View rows are searched. See the QUERY_MODE_... constants in ViewObject for different contants that can be specified (they can be OR'ed together).

If QUERY_MODE_SCAN_VIEW_ROWS is specified, the existing View rows in the current Row Set are scanned for matching rows.

If QUERY_MODE_SCAN_ENTITY_ROWS is specified, the Entity cache is searched for qualifying rows. If qualifying rows are found, they are added to the current Row Set. I.e., they become part of the current row collection. Internally, a finder View Object is created to search the Entity cache and to produce View rows from the Entity cache.

If QUERY_MODE_SCAN_DATABASE_TABLES is specified, a database query is issued to find matching rows. The View Criteria is converted into a where-clause. ViewObject.applyViewCriteria(ViewCriteria) on the finder View Object is invoked and the query executed.

Upon completion of this operation, the finder View Object is closed and removed.

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:
a RowSet (parented by the same View Object as this RowIterator) that contains qualifying rows. For convenience, this RowSet's range size is initialized to -1 (all rows).

findByEntity

public Row[] findByEntity(int eRowHandle,
                          int maxNumOfRows)
Description copied from interface: RowIterator
Finds and returns View rows that use the Entity row, identified by the Entity row handle, eRowHandle.
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:
an array of View rows that use the Entity row.

getPiggyback

protected byte[] getPiggyback()

getServiceMessage

protected ServiceMessage getServiceMessage()

processPiggyback

protected void processPiggyback(byte[] pb)

processServiceMessage

protected java.util.ArrayList processServiceMessage(ServiceMessage svcMsg)

isForwardOnly

public boolean isForwardOnly()
Description copied from interface: RowSet
Tests if the row set is constrained to sequential access.
Specified by:
isForwardOnly in interface RowSet
Returns:
true if the row set is restricted to forward-only processing.
See Also:
RowSet.setForwardOnly(boolean)

setForwardOnly

public void setForwardOnly(boolean isForwardOnly)
Description copied from interface: RowSet
Constrains the row set to sequential access.

When set to true, a row preceeding the current row cannot be designated as the new current row. This restriction allows performance to be optimized.

Specified by:
setForwardOnly in interface RowSet
Parameters:
isForwardOnly - true restricts the row set to forward-only processing, false otherwise.

getAccessMode

public byte getAccessMode()
Specified by:
getAccessMode in interface RowSet
Returns:
Returns the current access mode for this row set.
See Also:
RowSet.setAccessMode(byte)

setAccessMode

public void setAccessMode(byte mode)
Description copied from interface: RowSet
Constrains the row access based on the following settings:

Switching access modes for a rowset will not take effect until the next explicit call to executeQuery. Switching accessmode back to SCROLLABLE from any other mode is not allowed.

Specified by:
setAccessMode in interface RowSet
Parameters:
mode - One of the four enumerated values RowSet.SCROLLABLE, RowSet.FORWARD_ONLY, RowSet.RANGE_PAGING, RowSet.RANGE_PAGING_AUTO_POST.

getRangePagingCacheFactor

public int getRangePagingCacheFactor()
Specified by:
getRangePagingCacheFactor in interface RowSet

setRangePagingCacheFactor

public void setRangePagingCacheFactor(int f)
Specified by:
setRangePagingCacheFactor in interface RowSet

isAssociationConsistent

public boolean isAssociationConsistent()
Description copied from interface: RowSet
Returns the flag indicating whether association-consistent mode is on or not.
Specified by:
isAssociationConsistent in interface RowSet
Returns:
true if un-posted new rows are to appear, false otherwise. This flag has no effect if the view object is not entity based.
See Also:
RowSet.setAssociationConsistent(boolean)

setAssociationConsistent

public void setAssociationConsistent(boolean isConsistent)
Description copied from interface: RowSet
Sets the association-consistent flag for this row set.

Association-consistent mode allows the user to see new rows created/inserted through another view object. Note that this mode is effective only for view objects that are entity based. If the view object has no entity base, this mode has no effect.

Suppose we have an entity named E. Suppose two view objects, V1 and V2 are based on E. (V1 and V2 do not have to come from the same view definition.) Suppose the user creates a new row through V1. This creates an instance of E as well. The new entity row is registered only when its primary key is attribute set. At this time, an event is sent out to all view objects based on E, i.e., V1 and V2.

When V2 receives this event, it enumerates through all its collections (essentially its row sets--strictly speaking its query collections) looking for those whose isAssociationConsistent() value is true. For each row set whose flag value is true (say R2), it checks to see if it has any view row mapped to the new entity row. If not, it create a new view row and maps it to the new entity row. A rowInserted event fires.

Thus, from the user's view point, R2 is "seeing" the new row, although the row has not yet been posted to database. Hence, setting this flag to true enables the user to see new rows before the row is posted/queried when the view object is entity based.

If flag is false or if the view object is not entity based, the user needs to post the new row through Transaction.postChanges() and requery the row set through RowSet.executeQuery() to see the new row.

The default value for this flag can be globally controlled through the jbo.viewlink.consistent property. Its value can be true, false, or DEFAULT. If the property is not specified, the default value is DEFAULT. A similar property jbo.assoc.consistent controls whether the new-row-appearing behavior should be supported for row sets returned from entity association accessor calls. For jbo.assoc.consistent, supported values are true or false.

If the property value is set to true, all row sets will have true for its initial isAssociationConsistent() value. If the property value is set to false, all row sets will have false for its initial value. If the property value is set to DEFAULT (which is the default), the view object will use the following logic to compute its initial isAssociationConsistent() value: if the view object has multiple entity bases that are updateable, then the initial value is false. If the view object has a where-clause, then the initial value is false. Otherwise, it is true.

Once this method is called to set the flag value manually, neither the property setting nor the view object's initial flag value has an effect.

Specified by:
setAssociationConsistent in interface RowSet
Parameters:
isConsistent - indicates whether association-consistency should be on or not.

isMaxFetchSizeExceeded

public final boolean isMaxFetchSizeExceeded()
Description copied from interface: RowSet
Tests if the query result has been fetched to the end and the end was reached due to hitting the maxFetchSize limit
Specified by:
isMaxFetchSizeExceeded in interface RowSet
Returns:
true if the result set has been fetched to the maxFetchSize limit and there are still more rows in the database.

isFetchComplete

public boolean isFetchComplete()
Description copied from interface: RowSet
Tests if the query result set has been fetched to the end.
Specified by:
isFetchComplete in interface RowSet
Returns:
true if the result set has been fetched to the end.

addViewLinkAccessor

public AttributeDef addViewLinkAccessor(java.lang.String accrName)

finalize

protected void finalize()
void addRowCount(Object rowHandle) { Integer entry = (Integer) mRowCount.get(rowHandle); if (entry == null) { mRowCount.put(rowHandle, new Integer(1)); } else { mRowCount.put(rowHandle, new Integer(entry.intValue() + 1)); } } boolean releaseRowCount(Object rowHandle) { Integer entry = (Integer) mRowCount.get(rowHandle); int useCount = entry.intValue(); Diagnostic.ASSERT(entry != null, "Cannot find row use entry for handle = " + ((Integer) rowHandle).intValue()); if (useCount == 1) { mRowCount.remove(rowHandle); return true; } else { mRowCount.put(rowHandle, new Integer(useCount - 1)); return false; } }
Overrides:
finalize in class java.lang.Object

findViewLinkAccessor

public AttributeDef findViewLinkAccessor(ViewLink vl)
Description copied from interface: ViewObject
Finds the view link accessor attribute.
Specified by:
findViewLinkAccessor in interface ViewObject
Parameters:
vl - the view link whose accessor is being sought.
Returns:
the attribute definition if one is found. null if not.

getObjectMarshaller

protected ObjectMarshaller getObjectMarshaller()

writeXML

public Node writeXML(long options,
                     java.util.HashMap voAttrMap)
Description copied from interface: XMLInterface
Renders data in a canonical XML-format. The classes ViewObjectImpl and ViewRowImpl implement this method to render data in XML.

Use this method whenever data is required in XML format, either to present a UI (after converting XML data into some HTTP format using a stylesheet) or to pass the data as payload for messages via JMS.

The options parameter represents a set of bit flags that will control the writeXML behavior. The following bit flags have been defined:

The voAttrMap parameter represents in a hashmap, the mapping between a given ViewObject's definition type and the corresponding Attributes/accessors to render. A null entry in the hashmap means, render all attributes and accessors of that viewobject type.

Specified by:
writeXML in interface XMLInterface
Parameters:
options - a set of bit flags that will control the writeXML
voAttrMap - HashMap containing Definition names of ViewObjects and an array of AttributeDef to render for a ViewObject of that definition type.

writeXML

public Node writeXML(int depthCount,
                     long options)
Description copied from interface: XMLInterface
Renders data in a canonical XML-format. The classes ViewObjectImpl and ViewRowImpl implement this method to render data in XML.

Use this method whenever data is required in XML format, either to present a UI (after converting XML data into some HTTP format using a stylesheet) or to pass the data as payload for messages via JMS.

The depthcount parameter represents to what level the rendering should recurse. A depthcount of zero (0) means do not traverse any View Links while rendering. One (1) means traverse the View Links on this object but no View Links thereafter, and so on.

The options parameter represents a set of bit flags that will control the writeXML behavior. The following bit flags have been defined:

Specified by:
writeXML in interface XMLInterface
Parameters:
depthCount - represents to what level the rendering should recurse.
options - a set of bit flags that will control the writeXML behavior.

readXML

public void readXML(Element elem,
                    int depthCount)
Specified by:
readXML in interface XMLInterface

writeXML

public Node writeXML(long options,
                     java.util.HashMap voAttrMap,
                     XSLStylesheet xslt)
Specified by:
writeXML in interface XMLInterface

writeXML

public Node writeXML(int depthCount,
                     long options,
                     XSLStylesheet xslt)
Specified by:
writeXML in interface XMLInterface

readXML

public void readXML(Element elem,
                    int depthCount,
                    XSLStylesheet xslt)
Specified by:
readXML in interface XMLInterface

readRowXML

public void readRowXML(Element elem,
                       int depthCount)
Description copied from interface: ViewObject
Reads the data in XML form (in the format as generated by writeXML()) by finding a row that matches the key in the given XML and then reading in that row. If the row is not found, it tries to insert that row into this ViewObject with the attribute values from XML.

The depthcount parameter represents to what level the rendering should recurse. A depthcount of zero (0) means do not traverse any view links while rendering. One (1) means traverse the view links on this object but no view links thereafter, and so on.

Specified by:
readRowXML in interface ViewObject

readRowXML

public void readRowXML(Element elem,
                       int depthCount,
                       XSLStylesheet xslt)
Specified by:
readRowXML in interface ViewObject

getMaxFetchSize

public int getMaxFetchSize()
Description copied from interface: ViewObject
Maximum number of rows to fetch for this view object. This number takes effect in when the query for this view object is executed the next time.
Specified by:
getMaxFetchSize in interface ViewObject

setMaxFetchSize

public void setMaxFetchSize(int max)
Description copied from interface: ViewObject
Maximum number of rows to fetch for this view object. This number takes effect the next time the query for this view object is executed.

Passing -1 to this method will retrieve an unlimited number of rows. This is the default.

Passing 0 to this method will cause the database query not to be executed. The view object will initially work with an empty row set. If you want to execute query later, call setMaxFetchSize again with a non-zero argument, then call executeQuery().

Specified by:
setMaxFetchSize in interface ViewObject
Parameters:
max - the maximum number of rows to fetch. The default, -1, retrieves an unlimited number of rows. 0 causes the query not to be executed, and row set is empty.

getImplObject

public static oracle.jbo.client.remote.RowSetIteratorImpl getImplObject(java.lang.Object rsi)

setQueryOptimizerHint

public void setQueryOptimizerHint(java.lang.String hintText)
If this ViewObject does not have an expert mode query, then this hint is added to the select clause of the SQL for this ViewObject before the columns are listed e.g., SELECT \/*+ <hintText> *\/ columns... For expert mode queries, this hint is appended in the outer Select like: SELECT \/*+ <hintText> *\/ * FROM (<expert-query>)
Specified by:
setQueryOptimizerHint in interface ViewObject

getQueryOptimizerHint

public java.lang.String getQueryOptimizerHint()
Description copied from interface: ViewObject
Returns query optimizer Hint set for this ViewObject or for its definition object.
Specified by:
getQueryOptimizerHint in interface ViewObject

getApplicationModuleProxy

protected ApplicationModuleImpl getApplicationModuleProxy()

findAndSetCurrentRowByKey

public void findAndSetCurrentRowByKey(Key k,
                                      int rangeIndex)
Specified by:
findAndSetCurrentRowByKey in interface WSRowSetIteratorMarshaller

needsRefresh

public boolean needsRefresh()
Specified by:
needsRefresh in interface WSRowSetIteratorMarshaller

getDynamicAttributeOffset

public int getDynamicAttributeOffset()
Specified by:
getDynamicAttributeOffset in interface ViewObjectDynAttr

getDynamicAttributeCount

public int getDynamicAttributeCount()
Specified by:
getDynamicAttributeCount in interface ViewObjectDynAttr

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:
this object's current Variable Value Manager. May return null if one was not yet initialized.

hasVariables

public boolean hasVariables()
Description copied from interface: VariableManagerOwnerBase
Returns a flag indicating whether this object has Variables or not.
Specified by:
hasVariables in interface VariableManagerOwnerBase
Returns:
the flag indicating whether this object has Variables.

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:
this object's Variable Value Manager. Will create a Variable Value Manager if this object had no Variable Value Manager.

getVariableOpers

public java.util.ArrayList getVariableOpers()
Specified by:
getVariableOpers in interface WSVariableValueManagerMarshaller

resetVariableOpers

public void resetVariableOpers()
Specified by:
resetVariableOpers in interface WSVariableValueManagerMarshaller

mergeVariableValues

public void mergeVariableValues(Variable[] vars,
                                java.lang.Object[] varVals)
Specified by:
mergeVariableValues in interface WSVariableValueManagerMarshaller

getMessageBundleClass

public java.lang.Class getMessageBundleClass()
Specified by:
getMessageBundleClass in interface VariableManagerOwnerBase

getResourceBundleDef

public ResourceBundleDef getResourceBundleDef()
Specified by:
getResourceBundleDef in interface VariableManagerOwnerBase

getQueryTimeOut

public int getQueryTimeOut()
Description copied from interface: ViewObject
Returns the current query time out value. The default is QUERY_TIMEOUT_WAIT_FOREVER.
Specified by:
getQueryTimeOut in interface ViewObject
Returns:
the current query time out value.

setQueryTimeOut

public void setQueryTimeOut(int queryTimeOut)
Description copied from interface: ViewObject
Sets the query time out value for the view object. The default is QUERY_TIMEOUT_WAIT_FOREVER (-1), which means that the query will not time out. The user will be able to cancel the long running query by calling cancelQuery()

If a positive timeout value is specified, the query is monitored by a global monitor thread. The monitor thread waits the specified amount of time (approximately) in milli-seconds, and cancels the query by calling JDBC's Statement.cancel().

Specified by:
setQueryTimeOut in interface ViewObject
Parameters:
queryTimeOut - if non-negative, number of milli-seconds before the query is timed out. Or, it can be the QUERY_TIMEOUT_WAIT_FOREVER constants.

cancelQuery

public boolean cancelQuery()
Description copied from interface: RowSet
Cancels a running query.
Specified by:
cancelQuery in interface RowSet
Returns:
a flag indicating whether the request to cancel was honored or not. It will return false if the JDBC statement is not executing a query.

lookupListBindingDef

public ListBindingDef lookupListBindingDef(java.lang.String lbName)
Description copied from interface: ViewObject
Return listbinding definition if defined in this ViewObject (or in the entity definitions for entities that this ViewObject constitutes of).
Specified by:
lookupListBindingDef in interface ViewObject

findListBindingDef

public ListBindingDef findListBindingDef(java.lang.String name)
Description copied from interface: ViewObject
Return listbinding definition if defined in this ViewObject (or in the entity definitions for entities that this ViewObject constitutes of). This method unlike ViewObject.lookupListBindingDef(String) throws an exception if a listbinding definition of name lbName is not found.
Specified by:
findListBindingDef in interface ViewObject
Parameters:
name - listbinding name
Returns:
listbinding definition

deepCopy

public RowSet deepCopy(java.util.HashMap voAttrMap,
                       long options)
This method delegates to the default RowSet.
Specified by:
deepCopy in interface RowSet
Parameters:
voAttrMap - a name value pair of a View Object name and an array of its AttributeDef objects or an array of attribute names. A null value for this parameter results in copying all the non-key attribute values of this RowSet. View Links are not traversed for a null value.
options - valid values are RowSet.COPY_OPT_ALL_ROWS and RowSet.COPY_OPT_LIMIT_RANGE.
Returns:
a deep copy of the RowSet
See Also:
RowSet.deepCopy(java.util.HashMap, long)

setRequiredViewCriteria

public void setRequiredViewCriteria(ViewCriteria vc)
Description copied from interface: ViewObject
Setting a view criteria as required will enforce the criteria whenever the view object's query is executed. This criteria cannot be removed by using getViewCriteriaManager().clearViewCriterias or getViewCriteriaManager().removeViewCriteria API.
Specified by:
setRequiredViewCriteria in interface ViewObject
Parameters:
vc - Set the criteria as required view criteria for this view object instance.

getRequiredViewCriteria

public ViewCriteria getRequiredViewCriteria()
Description copied from interface: ViewObject
This method returns a reference to the required view criteria if one exists on this View Object. See ViewObject.setRequiredViewCriteria(oracle.jbo.ViewCriteria)
Specified by:
getRequiredViewCriteria in interface ViewObject

Skip navigation links

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

E10653-03


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