Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.server
Class ViewObjectImpl

java.lang.Object
  extended byoracle.jbo.common.NamedObjectImpl
      extended byoracle.jbo.server.NamedObjectImpl
          extended byoracle.jbo.server.ComponentObjectImpl
              extended byoracle.jbo.server.ViewObjectImpl
All Implemented Interfaces:
ComponentObject, EntityListener, java.util.EventListener, NavigatableRowIterator, Properties, RowIterator, RowSet, RowSetIterator, StructureDef, TransactionListener, TransactionPostListener, ViewObject, ViewObjectDynAttr, WSRowSetIteratorMarshaller, WSRowSetMarshaller, XMLInterface
Direct Known Subclasses:
FinderViewImpl

public class ViewObjectImpl
extends ComponentObjectImpl
implements ViewObject, EntityListener, TransactionListener, TransactionPostListener, WSRowSetMarshaller, WSRowSetIteratorMarshaller, ViewObjectDynAttr

The implementation of the ViewObject interface, the middle-tier class that manages database queries and the view rows that result from executing queries.

A View Object manages a view row set (ViewRowSetImpl). When the application calls a RowSet method on a View Object, the call is delegated to the its view row set, which performs the actual operation.

A View Object's base definition is provided by a View Definition object, which is built from the meta-data stored in an XML file. The View Object inherits many of its definitions from its View Definition, but applications can override them in instances.

A View Object persists until it, or the Application Module from which it was created, is explicitly deleted (using remove methods). You can use a given View Object definition more than once within an Application Module; the Business Component framework uses View instance names to distinguish between them.

Since:
JDeveloper 3.0
See Also:
ViewObject, RowSet, ViewRowSetImpl

Field Summary
protected static java.lang.String DATA_ROWKEYTAG
           
static byte FETCH_ALL
          A fetch mode that causes all rows to be retrieved from a JDBC result set immediately, and then closes the result set.
static byte FETCH_AS_NEEDED
          A fetch mode that causes rows to be retrieved from a JDBC result set as the user navigates through the row set.
static byte FETCH_DEFAULT
          A fetch mode that indicates that the default mode to be used.
static int FULLSQL_MODE_AUGMENTATION
          A full SQL mode that indicates that ViewObject level query augmentation (where-clause, order-by-clause) will be added to the query specified through a call to setQuery().
static int FULLSQL_MODE_NO_AUGMENTATION
          A full SQL mode that indicates that no ViewObject level query augmentation (where-clause, order-by-clause) will be added to the query specified through a call to setQuery().
protected  java.lang.String mAssocClause
           
protected  java.lang.String mAssocFromClause
           
protected  com.sun.java.util.collections.ArrayList mAssocRefs
           
protected  ViewAttributeDefImpl[] mAttrDefs
           
protected  com.sun.java.util.collections.HashMap mAttrDefsForExtendedVOs
           
protected  com.sun.java.util.collections.HashMap mAttrDefsTab
           
protected  boolean mAutoPostChanges
           
protected  int[] mChangedAttrIndices
           
protected  int mChgAttrIndUseCount
           
static int mDefaultMaxActiveNodes
           
static int mDefaultMaxRowsPerNode
           
static int MIN_ACTIVE_NODES
           
static int MIN_ROWS_PER_NODE
           
protected  ViewAttributeDefImpl[] mKeyAttrRefs
           
protected  java.lang.String mOptimizerHint
           
protected  java.lang.String mOrderBy
           
static boolean mUsePersColl
          The meaning of this static field has changed.
protected  java.lang.String mUserDefinedQuery
           
protected  ViewDefImpl mViewDef
           
protected  ViewRowSetImpl mViewRowSet
           
protected  java.lang.String mWhere
           
protected static java.lang.String NEW_ROW_HANDLE
           
protected static java.lang.String NEW_ROW_INDEX
           
protected static java.lang.String NEW_ROW_TRACKER
           
protected static java.lang.String QC_TAG
           
protected static java.lang.String TRANSIENT_DATA_ROWTAG
           
static java.lang.String XML_ELEM_PASSIVATE_TRANSIENT
           
 
Fields inherited from class oracle.jbo.common.NamedObjectImpl
mFullName, mObjName, mParent, mProperties
 
Fields inherited from interface oracle.jbo.RowSet
FORWARD_ONLY, RANGE_PAGING, RANGE_PAGING_AUTO_POST, 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
 
Constructor Summary
ViewObjectImpl()
          Constructs a new View Object.
ViewObjectImpl(java.lang.String name, ViewDefImpl voDef)
          Constructs a new View Object.
 
Method Summary
protected  ViewRowImpl activateCurrentRow(ViewRowSetIteratorImpl vrsi, ViewRowSetImpl vrs, Key key)
          Override this to provide custom current row lookup.
 void activateIteratorState(Element node, boolean clearIteratorState)
          Internal: Applications should not use this method.
protected  void activateNewRowTracker(Element parent)
          Deprecated. since 9.0.3.3
protected  void activateNewRowTracker(ViewRowSetImpl vrs, Element parent)
          Advanced Internal method only.
protected  void activateState(Element parent)
          Allows subclasses to retrieve custom data from an XML-node under the given parent element.
protected  void activateState(ViewRowImpl currentRow, Element parent)
          Deprecated. since 9.0.3.3 use activateState(ViewRowSetImpl vrs...)
protected  void activateState(ViewRowSetImpl vrs, ViewRowImpl currentRow, Element parent)
          Deprecated. since 9.0.3.3 use activateState(ViewRowSetImpl vrs...)
protected  void activateTransientAttribute(ViewRowImpl row, Node transRow, AttributeDefImpl ad)
          Override this method if activation of a transient attribute needs to also set/populate/ calculate some dependent attributes.
protected  void activateTransients(AttributeDefImpl[] attrs, Element parent)
          Deprecated. since 9.0.3.3 use activateTransients with ViewRowSetImpl
protected  void activateTransients(ViewRowSetImpl vrs, AttributeDefImpl[] attrs, Element parent)
          ReStores the attributes from the given array for either just the current row or all the rows in the given ViewRowSet into the given parent xml node.
 AttributeDef addDynamicAttribute(java.lang.String attrName)
          Adds a dynamic attribute to this View Object.
 void addListener(java.lang.Object listener)
          Registers an event listener with this View Object.
 void addManagementListener(RowSetManagementListener listener)
          Adds a subscriber (listener) to be notified of RowSetManagementListener events generated by this Row Set Iterator.
 void addOrderByClause(java.lang.String expr)
          Appends an expession to the query's ORDER BY clause.
protected  void addRowSet(ViewRowSetImpl rs)
           
protected  boolean addViewCriteriaToWhereClause()
           
protected  void addViewLink(ViewLinkImpl viewLink, boolean isReversed)
           
 void addWhereClause(java.lang.String expr)
          Appends an additional WHERE clause to the query.
 void afterCommit(TransactionEvent event)
          Handles events raised after a transaction has been committed.
protected  void afterEntityRemove(Entity srow)
          Notification handler called after an entity row is removed.
 void afterRemove(TransactionEvent event)
          Handles events raised after rows have been removed.
 void afterRollback(TransactionEvent event)
          Handles events raised after a transaction has been rolled back.
protected  void appendXMLElementNodes(oracle.jbo.server.RowSetImpl rs, Document xmlDoc, Node voNode, int depthCount, long options)
          Calls RowImpl.getXMLElementNodes to append row nodes to the given parent View Object node (voNode).
protected  void appendXMLElementNodes(oracle.jbo.server.RowSetImpl rs, Document xmlDoc, Node voNode, int depthCount, long options, com.sun.java.util.collections.HashMap voAttrMap)
          Calls RowImpl.getXMLElementNodes to append row nodes to the given parent View Object node (voNode).
 void applyViewCriteria(ViewCriteria criteria)
          Applies the view criteria to this View Object.
 void beforeCommit(TransactionEvent e)
          Handles events raised before a transaction is committed.
protected  void beforeEntityRemove(Entity entity)
          Notification handler called before an entity row is removed.
 void beforeRollback(TransactionEvent e)
          Handles events raised before a transaction is rolled back.
protected  void bindRangePagingParams(java.sql.PreparedStatement stmt, int noUserParams, int rangeStart, int rangeSize)
          If Applications override buildRangePaging() method to create a custom/wrapped query, they may also override this method to bind any/extra parameters that they add to the query.
protected  java.lang.String buildFromClause()
           
protected  RowFilter buildNewCollection(java.lang.Object[] newParamValues)
           
protected  boolean buildOrderByClause(java.lang.StringBuffer sqlBuffer, java.lang.String defOrderByClause)
          Builds the order-by-clause part of the query and adds it into the string buffer.
protected  RowFilter[] buildQualifyingRowFilters(java.lang.Object[] newParamValues)
           
protected  java.lang.String buildQuery(int noUserParams, boolean forRowCount)
           
protected  java.lang.String buildRangePagingQuery(java.lang.String qry, int noUserParams)
          Applications may use this method to wrap this ViewObject query with rownum query or other mechanism to fetch rows in the current range.
protected  RowFilter buildRowFilter(java.lang.Object[] paramValues)
           
protected  boolean buildWhereClause(java.lang.StringBuffer sqlBuffer, int noUserParams)
          Builds the WHERE clause part of the query and adds it into the string buffer.
protected  boolean checkPassivateViewAttributes()
          Applications should override this method to indicate if all View Attribute (Transient, SQLDerived or Dynamic) needs to be passivated when this ViewObject is passivated.
 void clearCache()
          Clears the View Object cache.
 void closeFreedStatements()
           
 void closeRowSet()
          Closes the Row Set.
 void closeRowSetIterator()
          Closes this row set iterator.
 Row createAndInitRow(AttributeList initVals)
          Creates and initializes a new Row object, but does not insert it into the Row Set.
 RowSet createDetailRowSet(java.lang.String rsName, java.lang.String linkDefName)
          Creates a detail Row Set.
 ViewRowImpl createInstance(ViewRowSetImpl viewRowSet, AttributeList attrValList)
          Creates a view row instance.
 ViewRowImpl createInstanceFromResultSet(QueryCollection qc, java.sql.ResultSet resultSet)
          Internal: Applications should not use this method.
 Key createKey(AttributeList nvp)
          Given a set of attribute values (name-value pairs), creates a key object for this ViewObject.
protected  ViewRowImpl createNewRowForCollection(java.lang.Object qc)
           
 Row createRow()
          Creates a new view row.
protected  ViewRowImpl createRowFromResultSet(java.lang.Object qc, java.sql.ResultSet resultSet)
           
 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 and returns a new (secondary) row set iterator for this row set.
 ViewCriteria createViewCriteria()
          Creates a new view criteria object for this View Object.
protected  ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl assocDef, ViewObjectImpl accessorVO, Row masterRow, java.lang.Object[] values)
           
protected  ViewObjectImpl createViewLinkAccessorVO(AssociationDefImpl assocDef, java.lang.String voName, ViewDefImpl vDef, ViewLinkDefImpl vlDef)
           
 java.lang.String createXMLDefinition(int depthCount)
          Creates a DTD definition for the View Object and all its contents (including contained RowSets if depthCount is non-zero).
 boolean doesRowFilterMatch(Row[] masterRows, java.lang.Object[] rowFilterValues)
           
 void dumpQCs()
          Internal: Applications should not use this method.
 java.util.Enumeration enumerateRowsInRange()
          Creates and returns an enumerator of the rows in the range.
 java.lang.Object[] executeDetailQuery(Row[] masterRows)
           
 void executeEmptyRowSet()
           
 void executeQuery()
          Executes the query.
protected  void executeQueryForCollection(java.lang.Object qc, java.lang.Object[] params, int noUserParams)
          This method is invoked right before the row set executes the query.
 void findAndSetCurrentRowByKey(Key key, int rangeIndex)
           
 AttributeDef findAttributeDef(java.lang.String name)
          Finds a named attribute definition.
 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.
 Row[] findByKey(Key key, int maxNumOfRows, boolean skipWhere)
           
 Row findRowInQCs(java.lang.Object[] rowFilterValues, Key key, java.lang.Object rowHandle)
          Internal: Applications should not use this method.
 RowSet findRowSet(java.lang.String rsName)
          Gets the named Row Set that was created at runtime for this View Object.
 RowSetIterator findRowSetIterator(java.lang.String rsiName)
          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.
protected  ViewObjectImpl findViewLinkAccessorVO(AssociationDefImpl assocDef, java.lang.String voName, ViewDefImpl vDef, ViewLinkDefImpl vlDef)
           
 Row first()
          Navigates to the first row in the row set.
 byte getAccessMode()
           
 Row[] getAllRowsInRange()
          Returns an array of all rows in the iterator's range.
 ApplicationModule getApplicationModule()
          Returns the application module to which this View Object belongs.
protected  java.lang.String getAssociationClause(int noUserParams)
          Internal: Applications should not use this method.
 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()
          Counts a View Object's attributes.
 AttributeDef getAttributeDef(int index)
          Gets the attribute definition at the specified position.
 AttributeDef[] getAttributeDefs()
          Constructs an array of attribute definitions.
 int getAttributeIndexOf(java.lang.String attrName)
          Gets the index of an attribute given its name.
 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).
 int getBindingStyle()
          Returns the binding style.
 ViewRowSetImpl getByKeyFinderRS()
          Internal: Applications should not use this method.
 int getCalculatedAttributeCount()
          Counts the number of "calculated" attributes.
 SvcMsgIteratorState getCliIteratorState()
           
 Row getCurrentRow()
          Returns the current row of the iterator.
 int getCurrentRowIndex()
          Returns the absolute row index of the iterator's current row.
 int getCurrentRowSlot()
          Returns the current row's slot status.
 DBTransaction getDBTransaction()
          Gets the transaction within which this View Object operates.
 ViewRowSetImpl getDefaultRowSet()
          Internal: Applications should not use this method.
 java.lang.String getDefFullName()
          Returns the full name of the view definition from which this View Object was created.
 java.lang.String getDefName()
          Returns the name of the view definition from which this view object was created.
protected  int[] getDeleteParticipants()
          Internal: Applications should not use this method.
 long getDetailEstimatedRowCount(Row[] masterRows)
           
 RowSet[] getDetailRowSets()
          Gets an array of detail Row Sets for which this Iterator is the master.
protected  int[] getDiscrColLoadIndices()
           
 int getDynamicAttributeCount()
          Internal: Applications should not use this method.
 int getDynamicAttributeOffset()
          Internal: Applications should not use this method.
protected  EntityDefImpl getEntityDef(int index)
          INTERNAL: Applications should not use this method.
protected  int getEntityDefCount()
          Internal: Applications should not use this method.
protected  EntityDefImpl[] getEntityDefs()
          Returns an array of entity definitions of the entity bases.
 int getEstimatedRangePageCount()
          Returns getEstimatedRowCount()/rangePageSize, if rangeSize > 0.
 long getEstimatedRowCount()
          Makes an estimated count of the rows in this row set.
 int getFetchedRowCount()
          Counts the number of rows fetched from the JDBC result set.
 byte getFetchMode()
          Gets the current fetch mode.
 short getFetchSize()
          Gets the row pre-fetch size.
 Row[] getFilteredRows(RowQualifier qualifier)
           
 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(RowQualifier qualifier)
           
 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.
 int getFullSqlMode()
           
static ViewRowSetIteratorImpl getImplObject(java.lang.Object rsi)
          Internal: Applications should not use this method.
protected  int[] getInsertParticipants()
          Internal: Applications should not use this method.
 int getIterMode()
          Gets the current iteration mode.
 AttributeDef[] getKeyAttributeDefs()
          Constructs an array of definitions of key attributes for the View Object.
protected  int[] getLockParticipants()
          Internal: Applications should not use this method.
 RowSetIterator[] getMasterRowSetIterators()
          Returns an array of all master row set iterators for this row set.
 int getMaxFetchSize()
          Gets the maximum row fetch size.
 Row[] getNextRangeSet()
          Gets the next set of rows in the range.
 java.lang.String getOrderByClause()
          Returns the query's ORDER BY clause.
 java.lang.Object[] getParametersAsStorageTypes()
          Constructs an array of the bind values used for binding arguments to the query.
protected  java.sql.PreparedStatement getPreparedStatement(int noUserParams, boolean[] barr)
           
 Row[] getPreviousRangeSet()
          Gets the previous set of rows in the range.
 AttributeDefImpl[] getPrimaryKeys()
          Constructs an array of entity attribute definitions of the primary keys of the View Object's Entity Objects.
 com.sun.java.util.collections.HashMap getPropertiesMap()
          Retrieves all properties pertaining to this View Object.
 java.lang.Object getProperty(java.lang.String propName)
          Retrieves the specified property.
 java.lang.String getProxyClassName()
          Internal: Applications should not use this method.
 java.lang.String getProxyInterfaceName()
           
protected  RowFilter[] getQualifyingRowFilters(java.lang.Object[] rowParamValues)
           
 java.lang.String getQuery()
          Returns the query statement.
 QueryCollection getQueryCollection()
          Internal: Applications should not use this method.
 long getQueryHitCount(ViewRowSetImpl viewRowSet)
          Counts the number of rows that would be returned if the View Object were executed with the current query.
 long getQueryHitCount(ViewRowSetImpl viewRowSet, Row[] masterRows)
           
 java.lang.String getQueryOptimizerHint()
          Returns any Query Optimizer Hint set for this ViewObject or for it's definition object.
 int getRangeIndexOf(Row row)
          Returns the range index of a given row.
 int getRangeSize()
          Returns the range size of the iterator.
 int getRangeStart()
          Returns the absolute row index of the first row in the range.
 Row getRow(Key key)
          Returns the first row matching a given key.
 Row getRowAtRangeIndex(int index)
          Returns the row at a given range position.
 java.lang.Class getRowClass()
          Gets the Java class of this View Object's rows.
 int getRowCount()
          Counts the total number of rows in this row set.
 int getRowCountInRange()
          Counts the rows actually in the range.
protected  java.util.Enumeration getRowFilters()
           
 java.lang.Object[] getRowFilterValues()
           
 Row getRowFromHandle(java.lang.Object hdl)
          Internal: Applications should not use this method.
 java.lang.String getRowProxyClassName()
          Internal: Applications should not use this method.
 RowQualifier getRowQualifier()
           
 RowSet getRowSet()
          Returns the View Object as a RowSet object.
 ViewRowSetImpl getRowSetImpl(java.lang.String name, java.lang.Object accessKey)
           
 RowSetIterator getRowSetIterator()
          Gets the row set iterator interface of this View Object.
 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.
 AttributeDef[] getScanRowFilterAttributeDefs()
           
 long getSignature()
          Internal: Applications should not use this method. Only for use in Object marshalling for remote tiers.
 java.lang.Object getSyncLock()
          Gets the locking object for this Row Set Iterator.
 int getTransPostHandle()
          Internal: Applications should not use this method.
protected  java.lang.Object getUserDataForCollection(java.lang.Object qc)
           
 java.lang.String getUserDefinedQuery()
          Gets the user-defined query, if one exists.
 ViewAttributeDefImpl[] getViewAttributeDefImpls()
          Internal: Applications should not use this method.
 ViewCriteria getViewCriteria()
          Gets the view criteria for this View Object.
 java.lang.String getViewCriteriaClause()
          Generates the WHERE clause expression from the view criteria.
protected  ViewDefImpl getViewDef()
          Internal: Applications should not use this method.
protected  com.sun.java.util.collections.ArrayList getViewLinkDestinationAttributes()
           
 java.lang.String[] getViewLinkNames()
          Constructs an array of names of View Links that involve this View Object.
 ViewLink[] getViewLinks()
          Constructs an array of View Links that involve this View Object.
 ViewObject getViewObject()
          Gets the View Object that contains this Row Set.
 java.lang.String getWhereClause()
          Gets the query's WHERE clause.
 java.lang.Object[] getWhereClauseParams()
          Constructs an array of the bind values currently specified for the query's WHERE clause.
 java.lang.String getXMLElementTag()
          Returns the XML element name for this View Object.
 java.lang.String getXMLRowElementTag()
          Returns the XML element name for this View Object.
protected  ViewRowImpl handleActivatedRowNotFound(Key k)
          Applications should override this method and create a new row if they want to "own" management of a row that was not found during this VOs activation.
 boolean hasDefaultRowSet()
           
 boolean hasNext()
          Indicates whether the iterator has a next row.
protected  boolean hasNextForCollection(java.lang.Object qc)
           
 boolean hasPrevious()
          Indicates whether the iterator has a previous row or not.
 void insertRow(Row row)
          Inserts a row into the row set.
 void insertRowAtRangeIndex(int index, Row row)
          Inserts a row into the row set at the specified range position.
 boolean isAssociationConsistent()
          Returns the state of the association-consistent flag for this row set.
 boolean isAutoPostChanges()
          Indicates whether auto-post-changes is enabled or not.
protected  boolean isCollectionPresent(RowFilter rowFilter)
           
 boolean isDynamicAttribute(int index)
          Indicates whether an attribute is dynamic.
 boolean isDynamicAttribute(java.lang.String name)
          Indicates whether the named attribute is dynamic.
 boolean isExecuted()
          Indicates whether the row set has been executed or not.
 boolean isFetchComplete()
          Tests if the query result set has been fetched to the end.
protected  boolean isForeignKey(ViewAttributeDefImpl attr)
          Checks if a view attribute is involved in a View Link in which this View Object is detail.
 boolean isForScan()
           
 boolean isForwardOnly()
          Indicates whether this row set is forward-only.
 boolean isInternal()
          Returns whether this View Object was created internally by BC4J or by an explicit user request.
 boolean isManageRowsByKey()
          Returns a flag indicating whether this View Object "manages rows by key" or not.
 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.
protected  boolean isPassivatableTransientAttribute(ViewAttributeDefImpl voAttr)
          Returns true if this Transient attribute should be passivated when the ViewObject data is being passivated.
 boolean isPassivationEnabled()
          Advanced method: Checks if passivation is enabled for this ViewObject.
 boolean isPostedToDB()
           
protected  boolean isQueryChanged()
          Internal: Applications should not use this method.
 boolean isRangeAtBottom()
          Indicates whether the iterator range contains the last row of the row set.
 boolean isRangeAtTop()
          Indicates whether the iterator range contains the first row of the row set.
 boolean isReadOnly()
          Tests whether this View Object is read-only.
 boolean isRowValidation()
          Gets the validation flag on this iterator.
 boolean isTransientTransactionListener()
          Tests whether this transaction listener is transient or permanent.
 boolean isTransientTransactionPostListener()
          Reports that this view object is not a transient transaction post listener.
 boolean isViewLinkAccessorRetained()
           
 Row last()
          Navigates to the last row in the row set.
 AttributeDef lookupAttributeDef(java.lang.String name)
          Finds a named attribute definition.
 Row next()
          Navigates to the next row in the row set.
protected  void notifyRowDeleted(ViewRowSetImpl vrs, Row viewRow, int rowIndex)
          This method is invoked by the framework when a row is deleted from the given ViewRowSet for this ViewObject.
protected  void notifyRowInserted(ViewRowSetImpl vrs, Row viewRow, int rowIndex)
          This method is invoked by the framework when inserts are made to the given ViewRowSet for this ViewObject.
protected  void notifyRowUpdated(ViewRowSetImpl vrs, Row[] viewRows, int[] attrIndices)
          This method is invoked by the framework when updates are made to any attribute for rows in the given ViewRowSet for this ViewObject.
protected  void passivateNewRowTracker(QueryCollection qc, RowFilterKey rf, Document doc, Element parent)
          Stores the NewRow index and keys.
protected  void passivateState(Document doc, Element parent)
          Allows subclasses to store custom data as XML-nodes under the given parent element, in the given document.
protected  void passivateState(ViewRowImpl currentRow, Document doc, Element parent)
          Allows subclasses to store custom data as XML-nodes under the given parent element, in the given document.
protected  void passivateState(ViewRowSetImpl vrs, ViewRowImpl currentRow, Document doc, Element parent)
          Override this to store custom data as XML-nodes for the given ViewRowSetImpl.
protected  void passivateTransients(ViewRowImpl currentRow, AttributeDefImpl[] attrs, Document doc, Element parent)
          Deprecated. since 9.0.3.3 use passivateTransients(ViewRowSetImpl vrs...)
protected  void passivateTransients(ViewRowSetImpl vrs, ViewRowImpl currentRow, AttributeDefImpl[] attrs, Document doc, Element parent)
          Stores the attributes from the given array for either just the current row or all the rows in the given ViewRowSet into the given parent xml node.
protected  void populateAttributeForRow(ViewRowImpl row, int index, java.lang.Object value)
           
 void postChanges(TransactionEvent e)
          This method is not implemented in this class.
protected  void prepareForActivation(Element amNode)
          Override this method to activate custom data in the ViewObject from this VO's xml node.
 void prepareForBatchMode(SvcMsgIteratorState iteratorState, boolean setCurrentRow)
           
protected  void prepareForPassivation(Document out, Element parent)
          Override this method to passivate custom data in the ViewObject, before any ViewObject settings are passivated.
 Row previous()
          Navigates to the previous row in the row set.
protected  java.lang.String printXMLDefinition(oracle.jbo.server.RowSetImpl rs, java.util.Hashtable allDefs, java.io.PrintWriter pw, int depthCount)
          Calls RowImpl.printXMLDefinition(java.util.Hashtable, java.io.PrintWriter, int) to generate the definition for the rowset and all its contents (including contained rowsets if depthCount is non-zero).
 void readFromXml(XmlDocumentReader reader, Element el)
           
 void readRowXML(Element rowElt, 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)
          Given the document interface, finds the rowset Element and invokes readFromXMLElementNode() to read in the data from the XML.
 void readXML(Element elem, int depthCount, XSLStylesheet xslt)
          Given the document interface, finds the rowset Element and invokes JboXMLUtil.processAndReadXML(XMLInterface, org.w3c.dom.Element, int, oracle.xml.parser.v2.XSLStylesheet) to read in the data from the XML.
 java.lang.Object[] refreshCollection(Row[] masterRows, boolean resetIter, boolean fillUpRange)
           
protected  void releaseUserDataForCollection(java.lang.Object qc, java.lang.Object data)
           
 void remove()
          Removes this View Object from its containing application module.
 void removeCurrentRow()
          Removes the current row.
 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 removeListener(java.lang.Object listener)
          Removes an event listener.
 void removeManagementListener(RowSetManagementListener listener)
          Removes a subscriber (listener) for RowSetManagementListener events generated by this row set iterator.
 boolean removeMasterRowSetIterator(RowSetIterator masterRSI)
          Removes the master row set iterator (masterRSI) from a master-detail View Link.
 void removeRowHandle(java.lang.Object hdl)
          Internal: Applications should not use this method.
protected  void removeRowSet(ViewRowSetImpl rs)
           
 void reset()
          Resets the iterator.
protected  void resetSession()
          BC4J invokes this method when a ViewObject is being reset for potential reuse by another client session.
protected  Row[] retrieveByKey(ViewRowSetImpl rs, Key key, int maxNumOfRows)
           
protected  Row[] retrieveByKey(ViewRowSetImpl rs, Key key, int maxNumOfRows, boolean skipWhere)
           
protected  boolean rowQualifies(ViewRowImpl vr)
           
 int scrollRange(int amount)
          Scrolls the range.
 int scrollRangeTo(Row row, int index)
          Scrolls the range to a specified row.
 int scrollToRangePage(int amount)
          Moves the row set range start to the given page index where every page consists of RangeSize number of rows.
 void setAccessMode(byte isAccessMode)
          Constrains the row access based on the following settings:
 void setAssociationConsistent(boolean isConsistent)
          Sets the association-consistent flag for this row set.
 void setAutoPostChanges(boolean bAutoPostChanges)
          Sets the auto-post-changes flag.
 void setBindingStyle(int bindingStyle)
          Sets the binding style.
 boolean setCurrentRow(Row row)
          Designates a given row as the current row.
 boolean setCurrentRowAtRangeIndex(int index)
          Designates a row at a specified position as the current row.
protected  void setFetchCompleteForCollection(java.lang.Object qc, boolean val)
           
protected  void setFetchMode(byte fetchMode)
          Sets the fetch mode.
 void setFetchSize(short size)
          Sets the number of rows that JDBC will fetch from the database during one round trip.
 void setForwardOnly(boolean isForwardOnly)
          Sets whether this row set will be forward-only or not.
 void setFullSqlMode(int fullSqlMode)
           
 void setIterMode(int mode)
          Sets the iteration mode for this Row Iterator.
 void setKeyAttributeDefs(int[] keyIndices)
          Advanced method: Sets the key attributes for this ViewObject to be the attributes at the given indices.
 void setListenToEntityEvents(boolean b)
          Sets the listen-to-entity-events flag.
 void setManageRowsByKey(boolean manageRowsByKey)
          Sets the flag indicating whethter this View Object "manages rows by key" or not.
 boolean setMasterRowSetIterator(RowSetIterator masterRSI)
          Sets the master row set iterator in a master-detail View Link.
 void setMaxFetchSize(int size)
          Maximum number of rows to fetch for this View Object.
 void setNestedSelectForFullSql(boolean b)
           
 void setOrderByClause(java.lang.String orderByClause)
          Sets the query's ORDER BY clause.
protected  void setPassivatableTransientAttribute(ViewAttributeDefImpl voAttr, boolean flag)
          Marks the given attribute def for this VO as passivatable.
 void setPassivationEnabled(boolean enabled)
          Advanced method: Enables/disables passivation for this ViewObject instance.
 void setPostedToDB(boolean b)
           
protected  void setProxyClassName(java.lang.String platform, java.lang.String proxyClassName)
          Internal: Applications should not use this method.
 void setQuery(java.lang.String query)
          Sets the user-defined query.
protected  void setQueryAsChanged(boolean isChanged)
           
protected  void setQueryChanged(boolean isChanged)
          Internal: Applications should not use this method.
 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 \/*+ *\/ columns...
 int setRangeSize(int size)
          Sets the range size for the iterator.
 int setRangeStart(int start)
          Positions the range.
protected  void setResultSetForCollection(java.lang.Object qc, java.sql.ResultSet rs)
           
 void setRowFilterValues(java.lang.Object[] rowFilterValues)
           
 void setRowQualifier(RowQualifier rowQualifier)
           
 void setRowValidation(boolean flag)
          Sets the validation flag on this iterator.
 void setTransPostHandle(int hdl)
          Internal: Applications should not use this method.
protected  void setUserDataForCollection(java.lang.Object qc, java.lang.Object data)
           
 void setViewCriteriaAdapter(ViewCriteriaAdapter adapter)
           
 void setViewLinkAccessorRetained(boolean b)
           
 void setWhereClause(java.lang.String whereClause)
          Sets the query's WHERE clause.
 void setWhereClauseParam(int index, java.lang.Object value)
          Sets a specified the bind value, by index position.
 void setWhereClauseParams(java.lang.Object[] values)
          Sets the query's bind values.
 void showCursorUsage(java.io.Writer out)
          Internal: Applications should not use this method.
 void sourceChanged(EntityEvent event)
          Handles events reported to (EntityListener)s.
protected  void updateRowSetFromXML(Element node, int depthCount, oracle.jbo.server.RowSetImpl rs)
          Creates a key from the given element's sub-elements to find an existing row.
 void validate()
          Validates all view rows within this View Object.
 Node writeXML(int depthCount, long options)
          Writes the contents of this View Object by creating a new RowSet and rendering it in XML.
 Node writeXML(int depthCount, long options, XSLStylesheet xslt)
          Writes the contents of this View Object by creating a new RowSet and rendering it in XML.
 Node writeXML(long options, com.sun.java.util.collections.HashMap voAttrRules)
          Renders data in a canonical XML-format.
 Node writeXML(long options, com.sun.java.util.collections.HashMap voAttrMap, XSLStylesheet xslt)
           
 
Methods inherited from class oracle.jbo.server.ComponentObjectImpl
addListener, create, createRef, getCompListeners, getCompListenersList, getProxyClassName, getRootApplicationModule, isRegWithPiggyMan, setName, setParent
 
Methods inherited from class oracle.jbo.server.NamedObjectImpl
setParent, setPropertiesMap
 
Methods inherited from class oracle.jbo.common.NamedObjectImpl
getFullName, getName, getParent, getProperties, getPropertiesAsStrings, refreshProperty, setFullName, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.StructureDef
getFullName, getName
 
Methods inherited from interface oracle.jbo.RowSet
getName
 
Methods inherited from interface oracle.jbo.Properties
getProperties, refreshProperty
 
Methods inherited from interface oracle.jbo.ComponentObject
getFullName, getName
 

Field Detail

FETCH_AS_NEEDED

public static final byte FETCH_AS_NEEDED
A fetch mode that causes rows to be retrieved from a JDBC result set as the user navigates through the row set. The result set is closed when the user reaches the end of the row.

See Also:
setFetchMode(byte), Constant Field Values

FETCH_ALL

public static final byte FETCH_ALL
A fetch mode that causes all rows to be retrieved from a JDBC result set immediately, and then closes the result set.

See Also:
setFetchMode(byte), Constant Field Values

FETCH_DEFAULT

public static final byte FETCH_DEFAULT
A fetch mode that indicates that the default mode to be used. Currently the default is FETCH_AS_NEEDED.

See Also:
setFetchMode(byte), Constant Field Values

FULLSQL_MODE_NO_AUGMENTATION

public static final int FULLSQL_MODE_NO_AUGMENTATION
A full SQL mode that indicates that no ViewObject level query augmentation (where-clause, order-by-clause) will be added to the query specified through a call to setQuery().

See Also:
setFullSqlMode(int), setQuery(String), Constant Field Values

FULLSQL_MODE_AUGMENTATION

public static final int FULLSQL_MODE_AUGMENTATION
A full SQL mode that indicates that ViewObject level query augmentation (where-clause, order-by-clause) will be added to the query specified through a call to setQuery().

See Also:
setFullSqlMode(int), setQuery(String), Constant Field Values

XML_ELEM_PASSIVATE_TRANSIENT

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

mViewDef

protected ViewDefImpl mViewDef

mAssocRefs

protected com.sun.java.util.collections.ArrayList mAssocRefs

mOptimizerHint

protected java.lang.String mOptimizerHint

mAssocFromClause

protected java.lang.String mAssocFromClause

mAssocClause

protected java.lang.String mAssocClause

mUserDefinedQuery

protected java.lang.String mUserDefinedQuery

mOrderBy

protected java.lang.String mOrderBy

mWhere

protected java.lang.String mWhere

mViewRowSet

protected ViewRowSetImpl mViewRowSet

mAttrDefs

protected ViewAttributeDefImpl[] mAttrDefs

mChgAttrIndUseCount

protected int mChgAttrIndUseCount

mChangedAttrIndices

protected int[] mChangedAttrIndices

mAttrDefsTab

protected com.sun.java.util.collections.HashMap mAttrDefsTab

mKeyAttrRefs

protected ViewAttributeDefImpl[] mKeyAttrRefs

mAttrDefsForExtendedVOs

protected com.sun.java.util.collections.HashMap mAttrDefsForExtendedVOs

mAutoPostChanges

protected boolean mAutoPostChanges

QC_TAG

protected static final java.lang.String QC_TAG
See Also:
Constant Field Values

NEW_ROW_TRACKER

protected static final java.lang.String NEW_ROW_TRACKER
See Also:
Constant Field Values

NEW_ROW_INDEX

protected static final java.lang.String NEW_ROW_INDEX
See Also:
Constant Field Values

TRANSIENT_DATA_ROWTAG

protected static final java.lang.String TRANSIENT_DATA_ROWTAG
See Also:
Constant Field Values

DATA_ROWKEYTAG

protected static final java.lang.String DATA_ROWKEYTAG
See Also:
Constant Field Values

NEW_ROW_HANDLE

protected static final java.lang.String NEW_ROW_HANDLE
See Also:
Constant Field Values

mUsePersColl

public static boolean mUsePersColl
The meaning of this static field has changed.

Before 9.0.2, we had two different ways of handling rows in a QueryCollection. The first used use Vector and the second used PCollection. Before 9.0.2, this field controlled which of these two ways would be used. If the user specifies jbo.user.pers.coll config parameter, it would set this field directly.

By 9.0.3, the Vector approach was effectively obsoleted. This flag was still present and could be used to choose the Vector approach. However, that was strongly discouraged. Having two different row management strategy was confusing and proned to problems. If the user specified jbo.use.pers.coll=false or true, that config param no longer affected this field. Regardless of the config param value, we used the PCollection approach. It instead controlled whether the PColl manager (owned by the DBTransactionImpl object) has a database persistence manager or not. If false, the PColl manager is created with no DB persistence manager. This means spill-to-disk will occur for no View Objects, regardless of the View Definition's PCollection related parameters.

If the user set this flag to false programmatically (which was still possible), we went with the Vector row management approach, but that code path was scarecely tested.

In 9.0.5, we removed the Vector management logic altogether. This static flag is still here. It now carries a slightly different meaning. When a QueryCollection is created, If this flag is false, and if the View Definition does not have a specific max-active-nodes value, it uses -1 as the max-active-nodes value, i.e., that View Object will not spill rows to disk.

The jbo.use.pers.coll config param has not changed its meaning. Thus, if jbo.use.pers.coll=false, no spill-to-disk will occur for all View Objects. Contrast that with jbo.pers.max.active.nodes=-1, which means no spill-to-disk for View Objects that do not have a max-active-nodes value in its View Definition. Setting mUsePersColl=false will have the same effect.


mDefaultMaxRowsPerNode

public static int mDefaultMaxRowsPerNode

mDefaultMaxActiveNodes

public static int mDefaultMaxActiveNodes

MIN_ROWS_PER_NODE

public static final int MIN_ROWS_PER_NODE
See Also:
Constant Field Values

MIN_ACTIVE_NODES

public static final int MIN_ACTIVE_NODES
See Also:
Constant Field Values
Constructor Detail

ViewObjectImpl

public ViewObjectImpl()
Constructs a new View Object.


ViewObjectImpl

public ViewObjectImpl(java.lang.String name,
                      ViewDefImpl voDef)
Constructs a new View Object.

Parameters:
name - the name to be assigned to the View Object.
voDef - a view definition.
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.

getProperty

public java.lang.Object getProperty(java.lang.String propName)
Retrieves the specified property. If it is not found in this View Object, is is retrieved from the view definition.

Specified by:
getProperty in interface Properties
Overrides:
getProperty in class NamedObjectImpl
Parameters:
propName - the name of the property.
Returns:
the property's value, or null if not found.

getPropertiesMap

public com.sun.java.util.collections.HashMap getPropertiesMap()
Retrieves all properties pertaining to this View Object.

Overrides:
getPropertiesMap in class NamedObjectImpl
Returns:
a hash table of the properties of the View Object and the view definition.

getApplicationModule

public final ApplicationModule getApplicationModule()
Returns the application module to which this View Object belongs. This method should not be overridden.

Specified by:
getApplicationModule in interface RowSet
Overrides:
getApplicationModule in class ComponentObjectImpl
Returns:
an application module.

getDefName

public java.lang.String getDefName()
Returns the name of the view definition from which this view object was created. This method should not be overridden.

The name returned has the format viewDefName.

The following code sample uses this method to detect if a View Link is a self-join:

      ViewLink info = appMod.findViewLink(viewName);
                // Detect if it is a self join with an accessor
                if (info.getSource().getDefName().equals(info.getDestination().getDefName()) &&
                    info.getSource().findViewLinkAccessor(info) != null)
                {
                   ...do some processing...
                }
 

Specified by:
getDefName in interface StructureDef
Overrides:
getDefName in class ComponentObjectImpl
Returns:
the view definition name, without its package name.

getDefFullName

public java.lang.String getDefFullName()
Returns the full name of the view definition from which this View Object was created. For example, given a View Object, use this method to get the View Def name, in order to create another instance of the object based on the View Def name.

The name has the format packageName.ViewDefName.

Specified by:
getDefFullName in interface StructureDef
Overrides:
getDefFullName in class ComponentObjectImpl
Returns:
the fully qualified view definition name.

getViewDef

protected ViewDefImpl getViewDef()
Internal: Applications should not use this method.

Returns the view definition object from which this View Object was created.

Returns:
the view definition.

getViewAttributeDefImpls

public ViewAttributeDefImpl[] getViewAttributeDefImpls()
Internal: Applications should not use this method.

Returns an array of view attribute definitions.

This array includes dynamic attributes (created through the addDynamicAttribute method) on this View Object.

This is an internal method. To get similar functionality, applications should use getAttributeDefs instead.

Returns:
an array of view attribute definitions.

getViewLinks

public ViewLink[] getViewLinks()
Constructs an array of View Links that involve this View Object.

A View Link can use this View Object as either its source or destination. To determine whether it is the source or destination, use code such as:

    viewLink.getDestination() == this
 
This method should not be overridden.

Returns:
the array of View Links.

getViewLinkNames

public java.lang.String[] getViewLinkNames()
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.

addViewLink

protected void addViewLink(ViewLinkImpl viewLink,
                           boolean isReversed)

isReadOnly

public boolean isReadOnly()
Tests whether this View Object is read-only.

A View Object is read-only if it does not have a Primary Key, or if all its Entity Objects are read-only.

This method should not be overridden.

Specified by:
isReadOnly in interface ViewObject
Returns:
true if this View Object is read-only; false if it is updateable.

getQueryCollection

public QueryCollection getQueryCollection()
Internal: Applications should not use this method.

Returns the query collection for this View Object's default row set.

Returns:
the QueryCollection for the default row set.

hasDefaultRowSet

public boolean hasDefaultRowSet()

getDefaultRowSet

public ViewRowSetImpl getDefaultRowSet()
Internal: Applications should not use this method.

Gets the default View Row Set.

This Row Set gets the same name as this View Object. This method should not be overridden.

Returns:
the default row set.

getWhereClause

public java.lang.String getWhereClause()
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. To get the WHERE clauses built from the View Object instance, the View definition, and the detail View Objects, use buildWhereClause

Specified by:
getWhereClause in interface ViewObject
Returns:
the WHERE clause; null if no WHERE clause exists.

addWhereClause

public void addWhereClause(java.lang.String expr)
Appends an additional WHERE clause to the query.

The new WHERE clause is appended to the current WHERE clause. This method does not interpose "AND" or any other conjunctive between the old and new clauses: the application must provide it.

The modified WHERE clause does not take effect until executeQuery() is called.

This method should not be overridden.

Parameters:
expr - the SQL WHERE clause to be appended.

setWhereClause

public void setWhereClause(java.lang.String whereClause)
Sets the query's WHERE clause.

The new WHERE clause does not take effect until executeQuery() is called. For an example usage of this method, see setWhereClause.

Note that calling setWhereClause() does not clear the previous settings of WHERE clause parameters. To reset WHERE clause parameters, call setWhereClauseParams explicitly with a null value. For example:

 vo.setWhereClauseParams(null);
 
This method should not be overridden.

Specified by:
setWhereClause in interface ViewObject
Parameters:
whereClause - a SQL WHERE clause.

getRowQualifier

public RowQualifier getRowQualifier()

setRowQualifier

public void setRowQualifier(RowQualifier rowQualifier)

rowQualifies

protected boolean rowQualifies(ViewRowImpl vr)

getOrderByClause

public java.lang.String getOrderByClause()
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:
the SQL ORDER BY clause; null if no ORDER BY clause exists.

addOrderByClause

public void addOrderByClause(java.lang.String expr)
Appends an expession to the query's ORDER BY clause.

The new expression is appended to the current order-by-clause, and a "," is interposed between them, if necessary.

The modified ORDER BY clause does not take effect until executeQuery is called.

This method should not be overridden.

Parameters:
expr - the SQL ORDER BY expression to be appended.

setOrderByClause

public void setOrderByClause(java.lang.String orderByClause)
Sets the query's ORDER BY clause.

The new ORDER BY clause does not take effect until executeQuery is called.

This method should not be overridden.

Specified by:
setOrderByClause in interface ViewObject
Parameters:
orderByClause - a SQL ORDER BY clause.

getWhereClauseParams

public java.lang.Object[] getWhereClauseParams()
Constructs an array of the bind values currently specified for the query's WHERE clause. This method delegates its call to the default RowSet.

This method should not be overridden.

Specified by:
getWhereClauseParams in interface RowSet
Returns:
the array of bind values.

isExecuted

public boolean isExecuted()
Indicates whether the row set has been executed or not.

Specified by:
isExecuted in interface RowSet
Returns:
true if the row set has been executed.

setWhereClauseParams

public void setWhereClauseParams(java.lang.Object[] values)
Sets the query's bind values. This method delegates its call to the default RowSet.

The new WHERE clause parameter values do not take effect until executeQuery is invoked. To reset WHERE clause parameters, call this method explicitly with a null value. For example:

  vo.setWhereClauseParams(null);
 
This method should not be overridden.

Specified by:
setWhereClauseParams in interface RowSet
Parameters:
values - an array of bind values.

setWhereClauseParam

public void setWhereClauseParam(int index,
                                java.lang.Object value)
Sets a specified the bind value, by index position. This method delegates its call to the default RowSet.

The new WHERE clause parameter value does not take effect until executeQuery is invoked.

In the following exmple, setWhereClause uses a hard-coded value for the the WHERE clause, and setWhereClauseParam specifies userID for the first (index=0) parameter position.

  ViewObject xVO = getUsersAvailableAssetsVO();
       String whereClause = "ASSET_ID = 100315";
       System.out.println("setWhereClause("+whereClause+") with
 setWhereClauseParam() after");
       xVO.setWhereClause(whereClause);
       xVO.setWhereClauseParam(0, userId);
       xVO.executeQuery();
       printVO(xVO);
 
This method should not be overridden.

Specified by:
setWhereClauseParam in interface RowSet
Parameters:
index - the position of the bind value.
value - the bind value.

getDBTransaction

public DBTransaction getDBTransaction()
Gets the transaction within which this View Object operates.

This method should not be overridden.

Returns:
the database transaction.

getFullSqlMode

public int getFullSqlMode()

setFullSqlMode

public void setFullSqlMode(int fullSqlMode)

getUserDefinedQuery

public java.lang.String getUserDefinedQuery()
Gets the user-defined query, if one exists.

This method is used when the View Object's query is created in Expert Mode. The View Object's query statement is normally built from various clauses, such as FROM, WHERE, and ORDER BY. An application can bypass this mechanism by supplying a complete query though setQuery.

This method returns null if the query was not created in Expert Mode.

Returns:
the user-defined SQL query if one exists, otherwise, null.

setNestedSelectForFullSql

public void setNestedSelectForFullSql(boolean b)

isViewLinkAccessorRetained

public boolean isViewLinkAccessorRetained()

setViewLinkAccessorRetained

public void setViewLinkAccessorRetained(boolean b)

getQuery

public java.lang.String getQuery()
Returns the query statement. Unlike 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.

buildQuery

protected java.lang.String buildQuery(int noUserParams,
                                      boolean forRowCount)

buildRangePagingQuery

protected java.lang.String buildRangePagingQuery(java.lang.String qry,
                                                 int noUserParams)
Applications may use this method to wrap this ViewObject query with rownum query or other mechanism to fetch rows in the current range. Note that bindRangePagingParameters() method will be called to fill in the range values when after other parameters for this query are bound.


bindRangePagingParams

protected void bindRangePagingParams(java.sql.PreparedStatement stmt,
                                     int noUserParams,
                                     int rangeStart,
                                     int rangeSize)
If Applications override buildRangePaging() method to create a custom/wrapped query, they may also override this method to bind any/extra parameters that they add to the query.


getQueryHitCount

public long getQueryHitCount(ViewRowSetImpl viewRowSet)
Counts the number of rows that would be returned if the View Object were executed with the current query.

This method obtains the row count by executing:

    SELECT COUNT(1) FROM query-statement ESTCOUNT
 
Based on the value returned, you might want to adjust the JDBC row prefetch size.

Returns:
the number of rows.

getQueryHitCount

public long getQueryHitCount(ViewRowSetImpl viewRowSet,
                             Row[] masterRows)

buildFromClause

protected java.lang.String buildFromClause()

buildWhereClause

protected boolean buildWhereClause(java.lang.StringBuffer sqlBuffer,
                                   int noUserParams)
Builds the WHERE clause part of the query and adds it into the string buffer.

The WHERE clause is made up of the following parts:

Parameters:
sqlBuffer - StringBuffer into which the WHERE clause is appended.
noUserParams - the number of bind variables in the WHERE clause. Typically, this number is getWhereClauseParams().length.
Returns:
true if a WHERE clause was appended.

buildOrderByClause

protected boolean buildOrderByClause(java.lang.StringBuffer sqlBuffer,
                                     java.lang.String defOrderByClause)
Builds the order-by-clause part of the query and adds it into the string buffer.

The order-by-clause is made up of the following parts:

Parameters:
sqlBuffer - StringBuffer into which the order-by-clause is appended.
defOrderByClause - order-by-clause from the definition object.
Returns:
true if an order-by-clause was appended.

setQuery

public void setQuery(java.lang.String query)
Sets the user-defined query.

The View Object's query statement is normally built from various clauses, such as FROM, WHERE, and ORDER BY. An application can bypass this mechanism by using this method to supply a complete query. The new query statement does not take effect until executeQuery is invoked.

Parameters:
query - a user-defined query statement.
Throws:
InvaildOperException - if this method is called on a View Object that is a detail of a View Link.

getParametersAsStorageTypes

public java.lang.Object[] getParametersAsStorageTypes()
Constructs an array of the bind values used for binding arguments to the query. If the bind values are domain instances the actual data is retrieved from the domain.

The resulting array is a union of the following sets of bind values:

Returns:
the array of the bind values as storage types, or null if none.

getRowClass

public java.lang.Class getRowClass()
Gets the Java class of this View Object's rows. Typically, this will be an instance of the oracle.jbo.server.ViewRowImpl class. If the Row Class (ViewRowImpl) was overridden during the Design Time, override this method.

Returns:
a Java class.
See Also:
ViewRowImpl

createInstance

public ViewRowImpl createInstance(ViewRowSetImpl viewRowSet,
                                  AttributeList attrValList)
Creates a view row instance.

This method is called by ViewObjectImpl.createRow(). The view row is created, and if it is a detail row for some View Link, its foreign key value attributes are initialized.

Parameters:
viewRowSet - the row set requesting the new row instance.
attrValList - a list of attribute values to be used for initializing the view row. If it is a detail row for some View Link, this list will contain foreign key values.
Returns:
a new view row instance.
See Also:
createRow()

createInstanceFromResultSet

public ViewRowImpl createInstanceFromResultSet(QueryCollection qc,
                                               java.sql.ResultSet resultSet)
Internal: Applications should not use this method.

Creates a view row instance from the query result.

This method is called as the user navigates through the query result. As rows are traversed through the JDBC ResultSet, view rows are created through calls to this method.

Parameters:
qc - query collection.
resultSet - JDBC ResultSet.
Returns:
a new view row instance.

createNewRowForCollection

protected ViewRowImpl createNewRowForCollection(java.lang.Object qc)

populateAttributeForRow

protected void populateAttributeForRow(ViewRowImpl row,
                                       int index,
                                       java.lang.Object value)

getDiscrColLoadIndices

protected int[] getDiscrColLoadIndices()

createRowFromResultSet

protected ViewRowImpl createRowFromResultSet(java.lang.Object qc,
                                             java.sql.ResultSet resultSet)

getEntityDefCount

protected int getEntityDefCount()
Internal: Applications should not use this method.

Returns the number of entity bases.

Returns:
the number of entity bases.

getEntityDef

protected EntityDefImpl getEntityDef(int index)
INTERNAL: Applications should not use this method.

Returns the definition of an entity base at the specified index.

Returns:
definition of the entity base.

getEntityDefs

protected EntityDefImpl[] getEntityDefs()
Returns an array of entity definitions of the entity bases.

This method could be used to perform meta-data initializations like "custom" Properties that are calculated using the current transaction.

Returns:
an array of entity definitions of the entity bases.

getLockParticipants

protected int[] getLockParticipants()
Internal: Applications should not use this method.

Returns an array of indices of entity bases that participate in processing the lock operation of the view row.

Returns:
an array of int indices of the entity bases.

getDeleteParticipants

protected int[] getDeleteParticipants()
Internal: Applications should not use this method.

Returns an array of indices of entity bases that participate in processing the delete (remove) operation of the view row.

Returns:
an array of int indices of the entity bases.

getInsertParticipants

protected int[] getInsertParticipants()
Internal: Applications should not use this method.

Returns an array of indices of entity bases that participate in processing the insert operation of the view row.

Returns:
an array of int indices of the entity bases.

getAttributeDefs

public AttributeDef[] getAttributeDefs()
Constructs an array of attribute definitions.

This array includes dynamic attributes created through addDynamicAttribute.

The following code snippet uses this method to create an array of attribute defninitions, then uses getName() to pull the attribute names from the definitions.

    AttributeDef[] meta = vo.getAttributeDefs();
     ...
    int attrCount = vo.getAttributeCount();
    for (int i = 0; i < attrCount; i++) {
    String curName = meta[i].getName();

           ...do some processing...
   }
 
This method should not be overridden.

Specified by:
getAttributeDefs in interface StructureDef
Returns:
an array of attribute definitions.

getKeyAttributeDefs

public AttributeDef[] getKeyAttributeDefs()
Constructs an array of definitions of key attributes for the View Object.

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.

getCalculatedAttributeCount

public int getCalculatedAttributeCount()
Counts the number of "calculated" attributes.

Calculated attributes are those that are not directly mapped to entity attributes, such as SQL derived attributes and association accessor attributes.

This method should not be overridden.

Returns:
the number of calculated attributes.

getPrimaryKeys

public AttributeDefImpl[] getPrimaryKeys()
Constructs an array of entity attribute definitions of the primary keys of the View Object's Entity Objects.

This method returns an array of Entity attribute definitions, in contrast to getKeyAttributeDefs, which returns an array of View attribute definitions.

If the View Object uses two or more Entity Objects, this method returns the concatenation of Entity attribute definitions.

This method should not be overridden.

Returns:
the array of entity attribute definitions.

getAssociationClause

protected java.lang.String getAssociationClause(int noUserParams)
Internal: Applications should not use this method.

Returns the where-clause expression generated from View Links.

Returns:
the where-clause expression generated from View Links.

executeQuery

public void executeQuery()
Executes the query.

This method does not necessarily retrieve data. The View Object's fetch mode determines whether the rows are retrieved immediately or not. If FETCH_AS_NEEDED is specified, the ResultSet is left open, and the rows are retrieved as the user navigates through the row set.

Calling this method will ensure that the user will see the latest data from the database, as well as the data changes that the user has made in the current transaction.

If the user changes the SQL statement, or modifies attributes used by it, view rows that were visible may "disappear" after this method is invoked, and the new WHERE clause takes effect.

When a row set is first instantiated and the application calls a navigational method such as, next(), previous(), first(), or last(), this method is implicitly called.

Upon successful execution of the query, this method fires a RangeRefreshEvent event to RowSetListener's registered with this object, by calling RowSetListener.rangeRefreshed().

Specified by:
executeQuery in interface RowSet
See Also:
setFetchMode(byte), RowSetListener.rangeRefreshed(oracle.jbo.RangeRefreshEvent), RangeRefreshEvent

executeEmptyRowSet

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

executeDetailQuery

public java.lang.Object[] executeDetailQuery(Row[] masterRows)
Specified by:
executeDetailQuery in interface WSRowSetMarshaller

executeQueryForCollection

protected void executeQueryForCollection(java.lang.Object qc,
                                         java.lang.Object[] params,
                                         int noUserParams)
This method is invoked right before the row set executes the query. If this method is overridden, the custom logic will be applied to all row sets.

In contrast, if the user overrides the view object's executeQuery(), the custom logic in it only applies only when the user calls executeQuery() on the view object. If he calls executeQuery() on secondary row sets, the custom logic in executeQuery() will not apply.

Parameters:
qc - the query collection about to execute the query.
params - the bind parameters that will be applied to the query.
noUserParams - the number of user bind parameters supplied through the setWhereClauseParam calls.

setResultSetForCollection

protected void setResultSetForCollection(java.lang.Object qc,
                                         java.sql.ResultSet rs)

hasNextForCollection

protected boolean hasNextForCollection(java.lang.Object qc)

setFetchCompleteForCollection

protected void setFetchCompleteForCollection(java.lang.Object qc,
                                             boolean val)

getUserDataForCollection

protected java.lang.Object getUserDataForCollection(java.lang.Object qc)

setUserDataForCollection

protected void setUserDataForCollection(java.lang.Object qc,
                                        java.lang.Object data)

releaseUserDataForCollection

protected void releaseUserDataForCollection(java.lang.Object qc,
                                            java.lang.Object data)

getAttributeCount

public int getAttributeCount()
Counts a View Object's attributes.

This number includes dynamic attributes created through addDynamicAttribute.

This method is used in the following helper function that prints data to the screen.

 // This is a helper method that prints data to the screen.
    public static void printRow(Row row) {
       String rowAttrs = "";
       for (int i = 0; i < row.getAttributeCount(); i++) {
         rowAttrs += (row.getAttribute(i) + "\t");
       }
       System.out.println(rowAttrs);
   }
 
This method should not be overridden.

Specified by:
getAttributeCount in interface StructureDef
Returns:
the number of attributes.

findAttributeDef

public AttributeDef findAttributeDef(java.lang.String name)
Finds a named attribute definition.

The following code snippet uses this method to find the attribute definitions needed to create a link between two View Objects.

   ViewObject voDept = myAM.createViewObject("MyDept", "package1.DeptVO");
   ViewObject voEmp = myAM.createViewObject("MyEmp", "package1.EmpVO");

   // Build an attribute array, consisting of DeptVO.DeptNum.
      AttributeDef[] deptAttrs = new AttributeDef[1];
      deptAttrs[0] = voDept.findAttributeDef("DeptNum");

   // Build an attribute array, consisting of EmpVO.DeptNum.
      AttributeDef[] empAttrs = new Attributedef[1];
      empAttrs[0] = voEmp.findAttributeDef("DeptNum");

      ViewLink vl = myAM.createViewLinkBetweenViewObjects("MyLink3",
           "Employees", // accessor name
           voDept, // master
           deptAttrs,
           voEmp, // detail
           empAttrs,
           null); // assoc clause
 
This method should not be overridden.

Specified by:
findAttributeDef in interface StructureDef
Parameters:
name - the name of the attribute.
Returns:
the attribute definition of the given name.
Throws:
InvalidDefNameException - if the name is invalid.
NoDefException - if the attribute is not found.

lookupAttributeDef

public AttributeDef lookupAttributeDef(java.lang.String name)
Finds a named attribute definition.

The following code snippet uses this method to find the attribute definitions needed to create a link between two View Objects.

   ViewObject voDept = myAM.createViewObject("MyDept", "package1.DeptVO");
   ViewObject voEmp = myAM.createViewObject("MyEmp", "package1.EmpVO");

   // Build an attribute array, consisting of DeptVO.DeptNum.
      AttributeDef[] deptAttrs = new AttributeDef[1];
      deptAttrs[0] = voDept.findAttributeDef("DeptNum");

   // Build an attribute array, consisting of EmpVO.DeptNum.
      AttributeDef[] empAttrs = new Attributedef[1];
      empAttrs[0] = voEmp.findAttributeDef("DeptNum");

      ViewLink vl = myAM.createViewLinkBetweenViewObjects("MyLink3",
           "Employees", // accessor name
           voDept, // master
           deptAttrs,
           voEmp, // detail
           empAttrs,
           null); // assoc clause
 
This method should not be overridden.

Specified by:
lookupAttributeDef in interface StructureDef
Parameters:
name - the name of the attribute.
Returns:
the attribute definition of the given name or null if no attribute was found.
Throws:
InvalidDefNameException - if the name is invalid.

getAttributeDef

public AttributeDef getAttributeDef(int index)
Gets the attribute definition at the specified position. The following code snippet uses this method to find and print the attribute names and values in a row.

    // Loop over the attributes in the Row and Print names and values
    for (int i = 0; i < vo.getAttributeCount(); i++)
    {
        String attrName = vo.getAttributeDef(i).getName();
        String attrVal  = r.getAttribute(i).toString();
        System.out.println(attrName + " = " + attrVal);
    }
 
This method should not be overridden.

Specified by:
getAttributeDef in interface StructureDef
Parameters:
index - the position of the attribute definition.
Returns:
the attribute definition, or null if the index is out of range.

getDynamicAttributeCount

public int getDynamicAttributeCount()
Internal: Applications should not use this method.

Returns the number of dynamic attributes.

Specified by:
getDynamicAttributeCount in interface ViewObjectDynAttr
Returns:
the number of dynamic attributes.

getDynamicAttributeOffset

public int getDynamicAttributeOffset()
Internal: Applications should not use this method.

Returns the attribute index of the first dynamic attribute.

Specified by:
getDynamicAttributeOffset in interface ViewObjectDynAttr
Returns:
the attribute index of the first dynamic attribute. -1 if this View Object has no dynamic attribute.

addDynamicAttribute

public AttributeDef addDynamicAttribute(java.lang.String attrName)
Adds a dynamic attribute to this View Object.

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 object.

If this attribute is to be passivated for failover/saveForLater/undo, the attribute-value should be able to recreate itself from its string representations. Types like Hashtables, Vectors etc. will not be handled automatically. For these one may create a domain and implement oracle.jbo.domain.XMLDomainWriter interface and then the domain can render itself as it feels fit. For a usage see source for oracle.jbo.domain.Array

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.
Throws:
NameClashException - if an attribute of the same name already exists.

getAttributeIndexOf

public int getAttributeIndexOf(java.lang.String attrName)
Gets the index of an attribute given its name.

For example:

 int idxQuantity  = this.getAttributeIndexOf("Quantity");
 
This method should not be overridden.

Specified by:
getAttributeIndexOf in interface StructureDef
Parameters:
attrName - the name of the attribute.
Returns:
the index of the attribute.
Throws:
NoDefException - if the attribute is not found.

isDynamicAttribute

public boolean isDynamicAttribute(int index)
Indicates whether an attribute is dynamic.

This method should not be overridden.

Parameters:
index - the attribute's position.
Returns:
true if the attribute is dynamic; false otherwise.

isDynamicAttribute

public boolean isDynamicAttribute(java.lang.String name)
Indicates whether the named attribute is dynamic.

This method should not be overridden.

Parameters:
name - the attribute'same.
Returns:
true if the attribute is dynamic, or false otherwise.

validate

public void validate()
Validates all view rows within this View Object.

This method enumerates through all rows in the row set and calls validate() on any that have been modified.

Throws:
ValidationException - if validation fails for any row.
See Also:
ViewRowImpl.validate()

isAutoPostChanges

public boolean isAutoPostChanges()
Indicates whether auto-post-changes is enabled or not. The default is false

If true, changes are automatically posted to the database before the View Object's query is executed.

Returns:
true if auto-post-changes is enabled.

setAutoPostChanges

public void setAutoPostChanges(boolean bAutoPostChanges)
Sets the auto-post-changes flag.

If enabled, changes are automatically posted to the database before the View Object's query is executed.

Parameters:
bAutoPostChanges - true enables auto-post-changes.

buildRowFilter

protected RowFilter buildRowFilter(java.lang.Object[] paramValues)

getRowFilters

protected java.util.Enumeration getRowFilters()

isCollectionPresent

protected boolean isCollectionPresent(RowFilter rowFilter)

getQualifyingRowFilters

protected RowFilter[] getQualifyingRowFilters(java.lang.Object[] rowParamValues)

buildNewCollection

protected RowFilter buildNewCollection(java.lang.Object[] newParamValues)

buildQualifyingRowFilters

protected RowFilter[] buildQualifyingRowFilters(java.lang.Object[] newParamValues)

getFetchMode

public byte getFetchMode()
Gets the current fetch mode.

For more information on fetch modes, see setFetchMode.

Returns:
the fetch mode. Can be FETCH_ALL or FETCH_AS_NEEDED.
See Also:
setFetchMode(byte)

setFetchMode

protected void setFetchMode(byte fetchMode)
Sets the fetch mode.

The fetchMode parameter should be one of the FETCH_... constants. This fetch mode controls how rows are retrieved out of JDBC's ResultSet.

After the query is executed, the row data are retrieved from the ResultSet. If FETCH_AS_NEEDED is specified, the result set is left open and rows are retrieved as the user navigates through the row set. If the user navigates to the end of the row set, the result set is closed.

If FETCH_ALL is specified, all rows are retrieved out of the results set even if the user has not navigated through the row set. After all rows are retrieved, the result set is closed.

Additionally, if FETCH_ALL is specified, any value for setFetchSize(short) is disregarded.

FETCH_DEFAULT is not implemented and should not used.

FETCH_ALL should be used if the number of rows in the row set relatively small and the number of row sets open on the View Object is large. This is because FETCH_ALL enables the user to avoid using up JDBC ResultSets. If FETCH_AS_NEEDED is specified and too many row sets are open (and left open because they are not navigated to the end), the user may run out of ResultSets. On the other hand, if the result set contains many rows, FETCH_ALL may not desirable because it incurs the cost of retrieving all rows up front.

For example, if your application does a lot of work with master-detail tables and the application does not fetch all of the rows from the detail, it could run out of cursors. If this happens, use FETCH_ALL.

Parameters:
fetchMode - the new fetch mode. Can be FETCH_ALL or FETCH_AS_NEEDED.

getBindingStyle

public int getBindingStyle()
Returns the binding style. Can be one of:

Returns:
the binding style. Can be one of BINDING_STYLE_ORACLE, BINDING_STYLE_JDBC, or BINDING_STYLE_UNKNOWN.

setBindingStyle

public void setBindingStyle(int bindingStyle)
Sets the binding style. Can be one of:

Parameters:
bindingStyle - the binding style. Can be one of BINDING_STYLE_ORACLE, BINDING_STYLE_JDBC, or BINDING_STYLE_UNKNOWN.

getFetchSize

public short getFetchSize()
Gets the row pre-fetch size.

The framework will use this value to set the JDBC row pre-fetch size. Note that the row pre-fetch size has performance ramifications. A larger fetch size is more expensive in terms of memory usage than a smaller size.

For each View Object, this method is customizable. Deciding what value to use could be made at runtime based on how many rows are expected for a particular View Object.

Returns:
the row pre-fetch size.

getMaxFetchSize

public int getMaxFetchSize()
Gets the maximum row fetch size.

This number is used to set the maximum number of rows to retrieve from JDBC. A value of 0 indicates all rows will be fetched.

Specified by:
getMaxFetchSize in interface ViewObject
Returns:
the maximum row fetch size.

setFetchSize

public void setFetchSize(short size)
Sets the number of rows that JDBC will fetch from the database during one round trip.

The framework will use this value to set the JDBC row pre-fetch size. Note that the row pre-fetch size has performance ramifications. A larger fetch size is more expensive in terms of memory usage than a smaller size. The default fetch size is 1 row.

If the value of setFetchMode(byte) is FETCH_ALL, then the value of setFetchSize is disregarded.

For each View Object, this method is customizable. Deciding what value to use could be made at runtime based on how many rows are expected for a particular View Object.

Parameters:
size - number of rows to fetch from the database. 1 is the default.
See Also:
setFetchMode(byte)

setMaxFetchSize

public void setMaxFetchSize(int size)
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. In other words, all the row returned by this ViewObject's query result set may be retrieved. 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

createViewCriteria

public ViewCriteria createViewCriteria()
Creates a new view criteria object for this View Object. A view criteria object is an alternative to using an arbitrary SQL statement. A view criteria is a list of row criteria for a View Object's WHERE clause, where a row criteria is an array containing criteria for the individual attributes.

A view criteria is a more structured way of creating a SQL query WHERE clause. After setting various conditions for the view criteria object, the application can call applyViewCriteria

This method should not be overridden.

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

addViewCriteriaToWhereClause

protected boolean addViewCriteriaToWhereClause()

applyViewCriteria

public void applyViewCriteria(ViewCriteria criteria)
Applies the view criteria to this View Object.

This method should not be overridden.

Specified by:
applyViewCriteria in interface ViewObject
Parameters:
criteria - the view criteria to apply.

getViewCriteria

public ViewCriteria getViewCriteria()
Gets the view criteria for this View Object.

This method should not be overridden.

Specified by:
getViewCriteria in interface ViewObject
Returns:
the view criteria, or null if none is specified.

setViewCriteriaAdapter

public void setViewCriteriaAdapter(ViewCriteriaAdapter adapter)

getViewCriteriaClause

public java.lang.String getViewCriteriaClause()
Generates the WHERE clause expression from the view criteria. The view criteria is used to generate a WHERE clause. This method returns a String representation of that clause.

This method should not be overridden.

Returns:
the SQL statement's WHERE clause.

isForScan

public boolean isForScan()

getScanRowFilterAttributeDefs

public AttributeDef[] getScanRowFilterAttributeDefs()

setKeyAttributeDefs

public void setKeyAttributeDefs(int[] keyIndices)
Advanced method: Sets the key attributes for this ViewObject to be the attributes at the given indices.

This method could be used to shorten the Key object for the rows of this ViewObject, if this ViewObject has a number of referenced entities and only one or a few updateable Entities, as long as

1. each row in the ViewObject is uniquely identifiable from the given set of key-attributes

2. the primary key of referenced entities are not updated in the cache. e.g, In case of EmpDeptView where Dept is referenced Entity if new Dept rows are added to the cache but not posted or Dept primary key values are changed, they may not be found by this ViewObject, as the key definition for this ViewObject may not have attribute-parts to identify the Depts in the cache. To avoid such cases, post changes for the Entites that make up references in this ViewObject before using findByKey


isManageRowsByKey

public boolean isManageRowsByKey()
Returns a flag indicating whether this View Object "manages rows by key" or not. This flag is meaningful only for a View Object which is not based on any Entity Object.

If a View Object has an Entity base, then View row cache manages View rows by the Entity rows on which each View row is based. For example, if you call findByKey on an Entity-based View Object, BC4J first locates the Entity row with the given primary key, then goes to this View row cache to find View rows that are based on this Entity row.

A View Object which is not based on any Entity Object does not have an Entity Object by which its rows can be organized. For such a View Object, you have an option to organize its rows by its keys. (For an EO-less View Object, its keys can be specified by setKeyAttributeDefs). This flag indicates whether the rows should be organized by its keys or not. The default is false.

When this flag is true, a small additional overhead will be added in View row management because of the bookkeeping associated with row management by key. However, findByKey will run faster because rows with match key can be found faster. Further, when this flag is true, findByKey can avoid returning duplicate rows in that the system can check to see if the row with the given key is already in the View row cache or not. If this flag is false, findByKey may cause duplicate rows to show up in the View row cache.

Note that for an EO based View Object, this flag is meaningless as rows are already organized and managed by its constituent Entity rows.

Returns:
a flag indicating whether rows are managed by its keys or not.

setManageRowsByKey

public void setManageRowsByKey(boolean manageRowsByKey)
Sets the flag indicating whethter this View Object "manages rows by key" or not. See isManageRowsByKey for explanation of flag.

Parameters:
manageRowsByKey - the new flag value. Note that if the View Object is EO-based, this flag is meaningless as rows are already organized and managed by its constituent Entity rows.

getRowSet

public RowSet getRowSet()
Returns the View Object as a RowSet object.

Note that the RowSetIterator.getRowSet() method returns the RowSet that owns the RowSetIterator. Since a View Object is a RowSetIterator, the object that owns the RowSetIterator for that View Object is the View Object itself.

Specified by:
getRowSet in interface RowSetIterator
Returns:
the owning Row Set.
See Also:
RowSetIterator.getRowSet()

getRowSetIterator

public RowSetIterator getRowSetIterator()
Gets the row set iterator interface of this View Object. That is, it returns the View Object as a RowSetIterator object.

Returns:
a row set interface.

next

public Row next()
Navigates to the next row in the row set.

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery() is implicitly called.

If the current row designation is to change, ViewRowImpl.validate() is called to validate the current row.

The row set has a "slot" before the first row, and one after the last row. When the row set is executed the iterator is positioned at the slot before the first row. If next() is invoked on a newly-executed row, the first row will be returned. If next() is called when the iterator is positioned on the last row of the row set, null is returned and the iterator is positioned at the slot following the last row.

If the iterator is at the last row of the range when next() is called, RowSetListener.rangeScrolled() is called to send ScrollEvent to registered RowSetListeners.

When successful, this method fires a NavigationEvent to registered RowSetListeners, by calling RowSetListener.navigated(). The row returned is designated as the current row.

Specified by:
next in interface RowIterator
Returns:
the next row, or null if no next row.
Throws:
ValidationException - if the prevously current row fails validation.
See Also:
NavigationEvent, RowSetListener, ScrollEvent, ViewRowImpl.validate()

previous

public Row previous()
Navigates to the previous row in the row set.

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery() is implicitly called.

If the current row designation is to change, ViewRowImpl.validate() is called to validate the current row.

The row set has a "slot" before the first row, and one after the last row. When the row set is executed the iterator is positioned at the slot before the first row. If previous() is called when the iterator is positioned on the first row of the row set, null is returned and the iterator is positioned at the slot preceeding the first row.

If the iterator is at the first row of the range when previous() is called, RowSetListener.rangeScrolled() is called to send ScrollEvent to registeredRowSetListeners.

When successful, this method fires a NavigationEvent to registered RowSetListeners, by calling RowSetListener.navigated(). The row returned is designated as the current row.

Specified by:
previous in interface RowIterator
Returns:
the previous row, or null if no previous row.
Throws:
ValidationException - if the prevously current row fails validation.
See Also:
NavigationEvent, RowSetListener, ScrollEvent, ViewRowImpl.validate()

first

public Row first()
Navigates to the first row in the row set.

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery() is implicitly called.

If the current row designation is to change, ViewRowImpl.validate() is called to validate the current row.

If the range does not include the first row when next() is called, RowSetListener.rangeScrolled() is called to send ScrollEvent to registered RowSetListeners.

When successful, this method fires a NavigationEvent to registered RowSetListeners, by calling RowSetListener.navigated(). The row returned is designated as the current row.

Specified by:
first in interface RowIterator
Returns:
the first row, or null if the set has no rows.
Throws:
InvalidOperException - if this is called on a forward-only row set, and the iterator has passed the first row.
ValidationException - if the prevously current row fails validation.
See Also:
NavigationEvent, RowSetListener, ViewRowImpl.validate()

last

public Row last()
Navigates to the last row in the row set.

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery() is implicitly called.

If the current row designation is to change, ViewRowImpl.validate() is called to validate the current row.

This method retrieves rows until the end of row set is found. Thus, this operation may be slow. If the range does not include the last row when next() is called, RowSetListener.rangeScrolled() is called to send ScrollEvent to registered RowSetListeners.

When successful, this method fires a NavigationEvent to registered RowSetListeners, by calling RowSetListener.navigated(). The row returned is designated as the current row.

Specified by:
last in interface RowIterator
Returns:
the last row, or null if the set has no rows.
Throws:
ValidationException - if the prevously current row fails validation.
See Also:
NavigationEvent, RowSetListener, ViewRowImpl.validate()

doesRowFilterMatch

public boolean doesRowFilterMatch(Row[] masterRows,
                                  java.lang.Object[] rowFilterValues)
Specified by:
doesRowFilterMatch in interface WSRowSetMarshaller

refreshCollection

public java.lang.Object[] refreshCollection(Row[] masterRows,
                                            boolean resetIter,
                                            boolean fillUpRange)
Specified by:
refreshCollection in interface WSRowSetMarshaller

reset

public void reset()
Resets the iterator.

This method delegates to the default RowSetIterator. The iterator is positioned to the slot before the first row, the state of a newly-executed row set.

Specified by:
reset in interface RowIterator

hasNext

public boolean hasNext()
Indicates whether the iterator has a next row.

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery is implicitly called.

This method does not move the current row.

Specified by:
hasNext in interface RowIterator
Returns:
true if the row set has a next row, or false if not.

hasPrevious

public boolean hasPrevious()
Indicates whether the iterator has a previous row or not.

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery is implicitly called.

This method does not move the current row.

Specified by:
hasPrevious in interface RowIterator
Returns:
true if the row set a previous row, or false if not.

isRangeAtBottom

public boolean isRangeAtBottom()
Indicates whether the iterator range contains the last row of the row set.

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery is implicitly called.

This method does not move the current row.

Specified by:
isRangeAtBottom in interface RowIterator
Returns:
true if the range contains the last row, or false if not.

isRangeAtTop

public boolean isRangeAtTop()
Indicates whether the iterator range contains the first row of the row set.

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery is implicitly called.

This method does not move the current row.

Specified by:
isRangeAtTop in interface RowIterator
Returns:
true if the range contains the first row, or false if not.

getFetchedRowCount

public int getFetchedRowCount()
Counts the number of rows fetched from the JDBC result set.

This method delegates to the default RowSetIterator.

This method can be used to determine whether the View Object has read all the rows from the cursor. For example, getEstimatedRowCount returns an equivalent of count(*) on the View Object. The getFetchedRowCount() method returns the count of rows already fetched. If getFetchedRowCount() returns a value less than getEstimatedRowCount(), then the View Object has not read all rows from the cursor.

Specified by:
getFetchedRowCount in interface RowIterator
Returns:
the number of rows already fetched.

getRowCount

public int getRowCount()
Counts the total number of rows in this row set.

This method retrieves all rows from the View Object by executing the View Object's query and then calling next() until the last row is retrieved. Thus, since it iterates through the View Object one record at a time, this method may be slow.

If you are working with a large number of rows, or if your application demands a fast response, use getEstimatedRowCount to obtain a quicker count.

The following sample code uses getRowCount() to set up separate iterators for even numbered and odd numbered rows:

 // Default iterator gets even-numbered rows.
 // Second iterator gets odd-numbered rows.
 long nRows = vo.getRowCount();
 String msg = "";
 for (int i = 0; i < nRows; i +=2) {

       // Get and set row index values relative to a range.
       // Index of first row = 0.
       vo.setCurrentRowAtRangeIndex(i);
       Row currRow = vo.getCurrentRow();
       msg = "  Default iterator (even): " + vo.getRangeIndexOf(currRow);
       printRow(currRow, msg);

       secondIter.setCurrentRowAtRangeIndex(i + 1);
       currRow = secondIter.getCurrentRow();
       msg = "  Second iterator (odd): " + vo.getRangeIndexOf(currRow);
       printRow(secondIter.getCurrentRow(), msg);
    }
 

Specified by:
getRowCount in interface RowIterator
Returns:
the number of rows in the row set.
See Also:
getEstimatedRowCount()

getEstimatedRowCount

public long getEstimatedRowCount()
Makes an estimated count of the rows in this row set.

This method estimates the number of rows in the row count by calling getQueryHitCount (which performs a SELECT COUNT (*) FROM table). Internal logic in Business Components for Java keeps the EstimatedRowCount up-to-date as rows are inserted and removed. Thus, after the first call to this method, it can return the estimated count quickly.

For example:

 // Get the rowcount again because of deleted or inserted row
 rowCount = (int) iter.getRowSet().getEstimatedRowCount();
 

If you are working with a large number of rows, or if your application demands a fast response, use this method instead of getRowCount.

Note however, that this method might not be as accurate as getRowCount(). To test whether the View Object has read all the rows from the cursor, you can use getEstimatedRowCount() in conjunction with getFetchedRowCount(). For example, getEstimatedRowCount() returns an equivalent of count(*) on the View Object. The getFetchedRowCount method returns the count of rows already fetched. If getFetchedRowCount() returns a value less than getEstimatedRowCount(), then the View Object has not read all rows from the cursor.

Specified by:
getEstimatedRowCount in interface RowSet
Returns:
an estimate of the number of rows in the row set.
See Also:
getQueryHitCount(ViewRowSetImpl), getFetchedRowCount()

getDetailEstimatedRowCount

public long getDetailEstimatedRowCount(Row[] masterRows)
Specified by:
getDetailEstimatedRowCount in interface WSRowSetMarshaller

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)
Sets the range size for the iterator.

The following code example creates one View Object, uses the default iterator to display one row at a time, and creates a second iterator on the same View Object to display a range of five rows.

  // Create the View Object within the context defined by the
  // Application Module. The View Object provides a default iterator.
     ViewObject vo = appMod.createViewObject(voName, voDefFile);

  // Create another iterator.
     RowSetIterator secondIter = vo.createRowSetIterator("Two");
     secondIter.setRangeSize(5);
 

Specified by:
setRangeSize in interface RowIterator
Parameters:
size - the new range size, or -1 if all rows are to be included.
Returns:
the new range size.
Throws:
InvalidOperException - if the iterator is forward-only and size is greater than 1.
See Also:
RowIterator.setRangeStart(int)

getRangeSize

public int getRangeSize()
Returns the range size of the iterator.

A range size of -1 indicates that the range will contain all the rows of the row set.

The following code sample uses this method as a parameter to scrollRange. Assume that printRows is a helper routine defined elsewhere.

  // Use the second iterator to print a range of rows.
     secondIter.scrollRange(secondIter.getRangeSize());
     printRows(secondIter.getAllRowsInRange());
 

Specified by:
getRangeSize in interface RowIterator
Returns:
the range size.

getRangeStart

public int getRangeStart()
Returns the absolute row index of the first row in the range.

An absolute row index is a row index in the entire row set.

For an example usage of this method, see setRangeStart

Specified by:
getRangeStart in interface RowIterator
Returns:
the absolute row index of the first row in the range.

setRangeStart

public int setRangeStart(int start)
Positions the range.

This method scrolls the range to make the row of the specified start index the first row of the range. If successful, RowSetListener.rangeScrolled() is called to send a ScrollEvent to registered RowSetListener.

If start indicates a row beyond the last row, the range will be scrolled to the end of the row set.

In the following code sample, the range starts with the fourth row. Assume that printRows is a helper function defined elsewhere.

    vo.setRangeStart(4);
    vo.setRangeSize(3);
    // this command prints rows 4 - 6.
    printRows(vo.getAllRowsInRange(), vo.getRangeStart());
 

Specified by:
setRangeStart in interface RowIterator
Parameters:
start - an absolute row index.
Returns:
the absolute row index of the first row of the resulting range.
See Also:
ScrollEvent, RowSetListener

scrollRange

public int scrollRange(int amount)
Scrolls the range.

The number of rows to scroll, amount, may be positive or negative. If negative, the range is scrolled upward (backward).

The following code sample scrolls the range two rows backwards.

 // Range window scrolls 2 rows backwards. Range size stays the same.
    vo.scrollRange(-2); // Positive scrolls forward, negative scrolls back.
 

If amount would scroll the range beyond either end of the row set, this method scrolls to that end of the range. After the range is scrolled, this method calls RowSetListener.rangeScrolled() to send a ScrollEvent to registered RowSetListeners.

Specified by:
scrollRange in interface RowIterator
Parameters:
amount - the number of rows to scroll.
Returns:
the actual number of rows scrolled. A negative number indicates an upward scroll.
Throws:
InvalidOperException - if this method is called on on a forward-only row set and amount is negative.
See Also:
ScrollEvent, RowSetListener

scrollToRangePage

public int scrollToRangePage(int amount)
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:
amount - the page number to go to in the result set.
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.

scrollRangeTo

public int scrollRangeTo(Row row,
                         int index)
Scrolls the range to a specified row.

This method scrolls the range to position the specified row at a specified range index. This operation may be slow.

After the range is scrolled, this method calls RowSetListener.rangeScrolled() to send a ScrollEvent to registered RowSetListeners.

Specified by:
scrollRangeTo in interface RowIterator
Parameters:
row - the row to scroll the range to.
index - the range index at which row is to be positioned.
Returns:
the actual number of rows scrolled. A negative number indicates an upward scroll.
Throws:
InvalidParamException - thrown if index is outside the range, or if row is not found in the row set.
InvalidOperException - thrown if this method is called on on a forward-only row set.
See Also:
ScrollEvent, RowSetListener

getRow

public Row getRow(Key key)
Returns the first row matching a given key.

This method retrieves rows from the database until a match is found or the end of the row set is reached.

If this View Object has multiple Entity Objects, the key need not be specified for all. When this is the case multiple rows may match the key. The first of these rows will be returned. This method differs from findByKey in the following respects:

This method does not fire any navigation event, nor does it move the range or the current row.

Specified by:
getRow in interface RowIterator
Parameters:
key - the key to be matched.
Returns:
the first matching row, or null if none match.
See Also:
findByKey(Key, int)

getRowAtRangeIndex

public Row getRowAtRangeIndex(int index)
Returns the row at a given range position.

Specified by:
getRowAtRangeIndex in interface RowIterator
Parameters:
index - a zero-based index within the range.
Returns:
the row at the specified range index, or null if index is outside of the range.

getRowFromHandle

public Row getRowFromHandle(java.lang.Object hdl)
Internal: Applications should not use this method.

Returns the row with a handle specified by hdl.

A view row can be assigned a handle unique in the running session (ViewRowImpl.getHandle). This handle can be used to get back the row. This method returns the row given the row handle.

The row handle is valid only within the running session and may not be persisted across sessions.

This method is an internal routine. The client should use the row's key (ViewRowImpl.getKey) if he wishes to get the row back at a later time. Also, the key may be persisted and used across sessions.

Parameters:
hdl - the row handle.
Returns:
the row identified by the row handle.
See Also:
ViewRowImpl.getHandle(), ViewRowImpl.getKey()

removeRowHandle

public void removeRowHandle(java.lang.Object hdl)
Internal: Applications should not use this method.

Removes the row handle from the row handle hash table.

A view row can be assigned a handle unique in the running session (ViewRowImpl.getHandle). This handle can be used to get back the row. This method removes the row handle from the row handle hash table.

Parameters:
hdl - the row handle to remove.
See Also:
ViewRowImpl.getHandle()

getCurrentRow

public Row getCurrentRow()
Returns the current row of the iterator.

This method delegates to the default RowSet iterator. If the row set has not been executed, or if this method is called immediately after the current row is removed, then it returns null (no current row).

Specified by:
getCurrentRow in interface RowIterator
Returns:
the current row. null if no current row.

getCurrentRowIndex

public int getCurrentRowIndex()
Returns the absolute row index of the iterator's current row. An absolute row index is a zero-based index relative to the entire row set.

This method is used in the following example that refreshes a viewPort.

   private void refresh()
   {
      // This is the expensive way where we refresh the entire viewPort
      fireTableDataChanged();
      int rangeRow = iter.getCurrentRowIndex();
      if (rangeRow >= 0) // -1 if null or out of range
      {
         int tableRow = rangeRow + iter.getRangeStart();
         table.setRowSelectionInterval(tableRow, tableRow);
      }
      else
     {
         table.clearSelection();
      }
 
If the row set has not been executed, or the iterator has been reset, -1 is returned.

Specified by:
getCurrentRowIndex in interface RowIterator
Returns:
the absolute row index of the current row, or -1 if there is no current row.

getCurrentRowSlot

public int getCurrentRowSlot()
Returns the current row's slot status.

The current row's slot status is one of the following oracle.jbo.RowIterator constants:

The following example uses a switch statement to return a different string message based on the value returned by this method.

    public String getCurrentRowSlot()
   {
      switch (mViewObject.getCurrentRowSlot())
      {
         case mViewObject.SLOT_VALID:
            return new String("SLOT_VALID");

         case mViewObject.SLOT_DELETED:
            return new String("SLOT_DELETED");

         case mViewObject.SLOT_BEFORE_FIRST:
            return new String("SLOT_BEFORE_FIRST");

         case mViewObject.SLOT_BEYOND_LAST:
            return new String("SLOT_BEYOND_LAST");
      }
 

Specified by:
getCurrentRowSlot in interface RowIterator
Returns:
the current row's slot status.
See Also:
RowIterator

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)
Designates a given row as the current row.

This method calls ViewRowImpl.validate to validate the previous current row.

After designating row as the current row, this method invokes RowSetListener.navigated() to send a NavigationEvent to registered RowSetListeners.

Specified by:
setCurrentRow in interface RowIterator
Parameters:
row - the row that is to become the current row.
Returns:
true if the current row designation was changed to row.
Throws:
ValidationException - if the previous current row fails validation.
See Also:
NavigationEvent, RowSetListener, ViewRowImpl.validate()

setCurrentRowAtRangeIndex

public boolean setCurrentRowAtRangeIndex(int index)
Designates a row at a specified position as the current row.

This method calls ViewRowImpl.validate to validate the previous current row.

After designating row as the current row, this method invokes RowSetListener.navigated() to send a NavigationEvent to registered RowSetListeners.

Specified by:
setCurrentRowAtRangeIndex in interface RowIterator
Parameters:
index - the position of the row that is to become the current row.
Returns:
true if the current row designation was changed to row.
Throws:
ValidationException - if the previous current row fails validation.
See Also:
NavigationEvent, RowSetListener, ViewRowImpl.validate()

createAndInitRow

public Row createAndInitRow(AttributeList initVals)
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:
initVals - a list of name-value pairs.
Returns:
a new Row object.

createRow

public Row createRow()
Creates a new view row. The new row is not placed in the entity cache until its primary key is initialized. It is inserted into the database when changes are posted to database and the transaction is committed.

Note that the constituent entities will be added to the entity-cache if the primary key of these entites are populated/set when the relevant entity's create() method is called. PrimaryKey attributes of Bc4J generated ID types (like RowID, DBSequence, etc) are defaulted before Entity.create and thus entities with such types as Primary Key attribute will be placed in the entity cache during create.

Following is a short example of a helper routine that uses this method to add a row to a View Object.

  public static void addRow(ApplicationModule appMod, ViewObject vo) {
    // Create a row and fill in the columns.
         Row newRow = vo.createRow();
         newRow.setAttribute("Deptno", new Number(14));
         newRow.setAttribute("Dname", "Pubs");
         newRow.setAttribute("Loc", "Honolulu");
         vo.insertRow(newRow);
 

Specified by:
createRow in interface RowIterator
Returns:
the new view row.

insertRow

public void insertRow(Row row)
Inserts a row into the row set.

The row is inserted at the current row position and becomes the current row. The indices for rows below the insertion point are incremented.

Upon successful insertion, this method invokes RowSetListener.rowInserted() to send a InsertEvent to registered RowSetListeners.

If you want to insert a row but not change currency consider using insertRowAtRangeIndex.

Specified by:
insertRow in interface RowIterator
Parameters:
row - the view row to insert.

insertRowAtRangeIndex

public void insertRowAtRangeIndex(int index,
                                  Row row)
Inserts a row into the row set at the specified range position.

The row is inserted at the given range index. The indices for rows below the insertion point are incremented.

Note that this method does not change currency. Upon successful insertion, this method invokes RowSetListener.rowInserted() to send a InsertEvent to registered RowSetListeners.

Specified by:
insertRowAtRangeIndex in interface RowIterator
Parameters:
index - the range index at which row is to be inserted.
row - the view row to insert.

removeCurrentRow

public void removeCurrentRow()
Removes the current row.

This method marks constituent Entity Object rows as deleted. When changes are posted to database or transaction committed, the database rows are deleted.

Upon successful removal of the row, the current row position does not move. However, the current row is set to null, and its slot status is set to SLOT_DELETED. Calling next() or previous() after removal will return a row adjacent to the removed row.

After removing the row, this method invokes RowSetListener.rowDeleted() to send a DeleteEvent to registered RowSetListeners.

Specified by:
removeCurrentRow in interface RowIterator
See Also:
RowSetListener.rowDeleted(oracle.jbo.DeleteEvent)

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 #removeAndRetain(), 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)
Returns the range index of a given row.

Specified by:
getRangeIndexOf in interface RowIterator
Parameters:
row - a row.
Returns:
the zero-based range index of the row, or -1 if the row is not within the range.

enumerateRowsInRange

public java.util.Enumeration enumerateRowsInRange()
Creates and returns an enumerator of the rows in the range.

Specified by:
enumerateRowsInRange in interface RowIterator
Returns:
an enumerator.

getAllRowsInRange

public Row[] getAllRowsInRange()
Returns an array of all rows in the iterator's range.

Specified by:
getAllRowsInRange in interface RowIterator
Returns:
an array of view rows.

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 #oracle.jbo.ScrollEvent to be sent to #oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the #oracle.jbo.RowSetListener interface. Further, this listener must be registered through a call to #oracle.jbo.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 #oracle.jbo.NavigationEvent and sends it to #oracle.jbo.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 #oracle.jbo.ScrollEvent to be sent to #oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the #oracle.jbo.RowSetListener interface. Further, this listener must be registered through a call to #oracle.jbo.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 #oracle.jbo.NavigationEvent and sends it to #oracle.jbo.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 contains 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. See ViewObject.isInternal().

Specified by:
getViewObject in interface RowSet
Returns:
the parent View Object.

setMasterRowSetIterator

public boolean setMasterRowSetIterator(RowSetIterator masterRSI)
Sets the master row set iterator in a master-detail View Link. The previous iterator, if any, is replaced.

The given iterator must be valid: a View Link must associate this detail View Object with another View Object, for which masterRSI is the master iterator.

Specified by:
setMasterRowSetIterator in interface RowSet
Parameters:
masterRSI - a master row set iterator.
Returns:
true if successful.

removeMasterRowSetIterator

public boolean removeMasterRowSetIterator(RowSetIterator masterRSI)
Removes the master row set iterator (masterRSI) from a master-detail View Link.

If masterRSI is a master row set iterator for this row set, it is removed from the list of master row set iterators.

Specified by:
removeMasterRowSetIterator in interface RowSet
Parameters:
masterRSI - master row set iterator to be removed.
Returns:
true if successful.

getMasterRowSetIterators

public RowSetIterator[] getMasterRowSetIterators()
Returns an array of all master row set iterators for this row set.

Specified by:
getMasterRowSetIterators in interface RowSet
Returns:
an array of all master row set iterators.

getDetailRowSets

public RowSet[] getDetailRowSets()
Gets an array of detail Row Sets for which this Iterator is the master.

In a master-detail relationship in an Application Module, the master in reality is a Row Set Iterator. (Though we often speak of master View Object, in reality, it is the Iterator behind the View Object which is playing the role of the master). Whenever the currency of this master Iterator moves, the detail Row Sets are re-executed to show related Rows.

Calling this method returns an array of Row Sets that are related to this Iterator as detail Row Sets.

Specified by:
getDetailRowSets in interface RowSetIterator
Returns:
an array of detail RowSet.

createDetailRowSet

public RowSet createDetailRowSet(java.lang.String rsName,
                                 java.lang.String linkDefName)
Creates a detail Row Set. See getDetailRowSets() for explanation of detail Row Sets.

This method creates a new detail Row Set for this Iterator.

Specified by:
createDetailRowSet in interface RowSetIterator
Parameters:
rsName - 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 new detail Row Set.

addListener

public void addListener(java.lang.Object listener)
Registers an event listener with this View Object.

The listener listens to changes on the rows. Typical events that it listens for are scrolls to the next row, currency changes, deletes/inserts/updates/executes on a row.

Specified by:
addListener in interface NavigatableRowIterator
Parameters:
listener - a RowSetListener instance.
See Also:
RowSetListener

removeListener

public void removeListener(java.lang.Object listener)
Removes an event listener.

Specified by:
removeListener in interface NavigatableRowIterator
Parameters:
listener - the listener to be removed.

addManagementListener

public void addManagementListener(RowSetManagementListener listener)
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:
listener - the subscriber to be added. It should implement RowSetManagementListener.

removeManagementListener

public void removeManagementListener(RowSetManagementListener listener)
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:
listener - the subscriber to be removed.

createRowSet

public RowSet createRowSet(java.lang.String name)
Creates and returns a new (secondary) row set for this View Object.

Specified by:
createRowSet in interface ViewObject
Parameters:
name - the name of the new row set.
Returns:
the new row set.

createRowSetIterator

public RowSetIterator createRowSetIterator(java.lang.String name)
Creates and returns a new (secondary) row set iterator for this row set.

The following example creates a second iterator on a View Object and sets the range size to 5.

    // Create another iterator.
    RowSetIterator secondIter = vo.createRowSetIterator("Two");
    secondIter.setRangeSize(5);
 

Specified by:
createRowSetIterator in interface RowSet
Parameters:
name - the name of the new row set iterator.
Returns:
the new row set iterator.

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 rsiName)
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:
rsiName - 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()
Counts the rows actually in the range.

If the range is at the end of the row set, the number of rows in the range may be less than the range size.

The definition of getChildCount() uses the number of rows returned by this method to represent the number of child rows.

   // Returns the number of children.
   public int getChildCount()
   {
      if (children == null)
      {
         return 0;
      }
      else
      {
         return children.getRowCountInRange();
      }
   }
 

Specified by:
getRowCountInRange in interface RowIterator
Returns:
the actual number of rows in the range.

findByKey

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

See #oracle.jbo.RowIterator.findByKey(oracle.jbo.Key, int) for details.

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.
See Also:
getRow(oracle.jbo.Key)

findAndSetCurrentRowByKey

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

findByKey

public Row[] findByKey(Key key,
                       int maxNumOfRows,
                       boolean skipWhere)

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.

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.

setQueryChanged

protected void setQueryChanged(boolean isChanged)
Internal: Applications should not use this method.

Sets whether the query should be marked changed or not.

If the query is marked as changed, this method walks through the list of view row sets and tells each to refresh its content.

Parameters:
isChanged - the new change flag.

setQueryAsChanged

protected void setQueryAsChanged(boolean isChanged)

isQueryChanged

protected boolean isQueryChanged()
Internal: Applications should not use this method.

Indicates whether the query is marked changed or not.

Returns:
indicates whether the query is marked changed or not. Returns true if marked changed; false otherwise.

notifyRowInserted

protected void notifyRowInserted(ViewRowSetImpl vrs,
                                 Row viewRow,
                                 int rowIndex)
This method is invoked by the framework when inserts are made to the given ViewRowSet for this ViewObject. This method can be overridden to perform calculations in a subclass or to cache a list of new rows for some other reason.

Parameters:
vrs - ViewRowSetImpl instance to be notified about the new row.
viewRow - View Row instance that have been inserted.

notifyRowDeleted

protected void notifyRowDeleted(ViewRowSetImpl vrs,
                                Row viewRow,
                                int rowIndex)
This method is invoked by the framework when a row is deleted from the given ViewRowSet for this ViewObject. This method can be overridden to perform calculations in a subclass or to cache a list of deleted rows for some other reason.

Parameters:
vrs - ViewRowSetImpl instance to be notified about the deleted row.
viewRow - View Row instance that have been deleted.

notifyRowUpdated

protected void notifyRowUpdated(ViewRowSetImpl vrs,
                                Row[] viewRows,
                                int[] attrIndices)
This method is invoked by the framework when updates are made to any attribute for rows in the given ViewRowSet for this ViewObject. This method can be overridden to perform calculations in a subclass if a particular attribute changes. Also, if the sub-class wants to block event-propogation to some/all rowsets of this viewobject, this method could be used to perform such filtering

Parameters:
vrs - ViewRowSetImpl instance to be notified about the attribute(s) update
viewRows - A collection of View Row instances that have been modified.
attrIndices - A collection of attribute indices in the View Rows that have been modified.

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 rsName)
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:
rsName - 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.

getRowSetImpl

public ViewRowSetImpl getRowSetImpl(java.lang.String name,
                                    java.lang.Object accessKey)

addRowSet

protected void addRowSet(ViewRowSetImpl rs)

removeRowSet

protected void removeRowSet(ViewRowSetImpl rs)

getViewLinkDestinationAttributes

protected com.sun.java.util.collections.ArrayList getViewLinkDestinationAttributes()

isForeignKey

protected boolean isForeignKey(ViewAttributeDefImpl attr)
Checks if a view attribute is involved in a View Link in which this View Object is detail.

Parameters:
attr - a view attribute definition.
Returns:
true if attr is a foreign key.

getSignature

public long getSignature()
Internal: Applications should not use this method. Only for use in Object marshalling for remote tiers.


getProxyClassName

public java.lang.String getProxyClassName()
Internal: Applications should not use this method.

Returns the name of this View Object's proxy class. The proxy is the name of the class to instantiate on the client (in 3-tier case) to play the role of remote proxy for this view object. The proxy class name can be different depending on the Application Server platform. For example, for Visibroker, the proxy class name can be "X", while for Oracle8i the name of the same proxy class can be "Y".

Overrides:
getProxyClassName in class ComponentObjectImpl
Returns:
the proxy class name.

getProxyInterfaceName

public java.lang.String getProxyInterfaceName()

setProxyClassName

protected void setProxyClassName(java.lang.String platform,
                                 java.lang.String proxyClassName)
Internal: Applications should not use this method.

Sets the name of this View Object's proxy class, given a platform name.

The platforms currently recognized are VB (Visibroker) and 8i (Oracle8i). The proxy class name can be different depending on the Application Server platform. For example, for Visibroker, the proxy class name can be "X", while for Oracle8i the name of the same proxy class can be "Y".

Overrides:
setProxyClassName in class ComponentObjectImpl
Parameters:
platform - name of the platform. Currently, can be either VB (Visibroker) or 8i (Oracle8i).
proxyClassName - a name for the proxy class.

getRowProxyClassName

public java.lang.String getRowProxyClassName()
Internal: Applications should not use this method.

Returns the name of this View Object's row proxy class.

Returns:
the proxy class name.

remove

public void remove()
Removes this View Object from its containing application module. This method can be used for View Objects created either at Design Time or at runtime.

If you subclassed View Object to perform some tasks that are not a normal part of the View Object functionality, then you might have to override this method.

Specified by:
remove in interface ComponentObject
Overrides:
remove in class ComponentObjectImpl
Throws:
InvalidOperException - if the View Object is involved in a View Link. Remove View Links before removing the View Object.

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

getAccessMode

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

setAccessMode

public void setAccessMode(byte isAccessMode)
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:
isAccessMode - One of the four enumerated values SCROLLABLE, FORWARD_ONLY, RANGE_PAGING, RANGE_PAGING_AUTO_POST

setForwardOnly

public void setForwardOnly(boolean isForwardOnly)
Sets whether this row set will be forward-only or not.

Forward-only row sets manage only one row, and constrain users to working only with the current row. Data-update operations are not allowed.

Forward-only row sets are useful for batch operations which proceed linearly. The only allowed navigation operation is next(). A foward-only row set is faster and consumes fewer resources than a normal row set.

Specified by:
setForwardOnly in interface RowSet
Parameters:
isForwardOnly - true if the row set should be forward-only.

isForwardOnly

public boolean isForwardOnly()
Indicates whether this row set is forward-only.

Forward-only row sets manage only one row, and constrain users to working only with the current row. Data-update operations are not allowed.

Forward-only row sets are useful for batch operations which proceed linearly. The only allowed navigation operation is next(). A foward-only row set is faster and consumes fewer resources than a normal row set.

Specified by:
isForwardOnly in interface RowSet
Returns:
true if the row set is forward-only.
See Also:
RowSet.setForwardOnly(boolean)

setAssociationConsistent

public void setAssociationConsistent(boolean isConsistent)
Sets the association-consistent flag for this row set.

When association-consistency is disabled (the default), changes made in one View Object may not be visible in other View Objects until posted to the database.

When association-consistency is enabled, modified data will be fetched from the cache, rather than from the database, so changes will be visible before they are posted. Rows with modified foreign keys, newly created rows, deletions will be consistently shown. However, performace will be degraded. If association-consistency is on, the row set will reflect rows with modified foreign keys, newly created rows, and removed (deleted) rows.

If association-consistency is off, the user can post the pending changes to database. This way all subsequent queries into the database will include the data changes.

This method is relevant only if this row set was returned by a call to an entity association accessor. This methodl's default value is true for Entity Associations View Objects and false for View Link View Objects.

Specified by:
setAssociationConsistent in interface RowSet
Parameters:
isConsistent - true if association-consistency is to be enabled.

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.

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.

isAssociationConsistent

public boolean isAssociationConsistent()
Returns the state of the association-consistent flag for this row set.

Specified by:
isAssociationConsistent in interface RowSet
Returns:
the association-consistent flag for this row set.
See Also:
setAssociationConsistent(boolean)

getPreparedStatement

protected java.sql.PreparedStatement getPreparedStatement(int noUserParams,
                                                          boolean[] barr)

closeFreedStatements

public void closeFreedStatements()

showCursorUsage

public void showCursorUsage(java.io.Writer out)
Internal: Applications should not use this method.

Debug routine that prints the cursor usage for this View Object.

Parameters:
out - where to write the output.

beforeEntityRemove

protected void beforeEntityRemove(Entity entity)
Notification handler called before an entity row is removed.

If some action causes an entity row to be removed, this handler is invoked (before the entity row is removed). The user can override this method to respond to the remove event. Note that this handler is invoked regardless of whether the removed entity affects one of the rows in this View Object.

Parameters:
entity - entity about to be removed.

afterEntityRemove

protected void afterEntityRemove(Entity srow)
Notification handler called after an entity row is removed.

If some action causes an entity row to be removed, this handler is invoked (after the entity row is removed). The user can override this method to respond to the remove event. Note that this handler is invoked regardless of whether the removed entity affects one of the rows in this View Object.


sourceChanged

public void sourceChanged(EntityEvent event)
Handles events reported to (EntityListener)s.

This event is sent by the entity cache to notify listeners of changes to entity rows. It is invoked for attribute changes and row removal.

When rows are remmoved this method is invoked twice, first as a BEFORE_REMOVE event, and then as a STATE_CHANGE event.

Specified by:
sourceChanged in interface EntityListener
Parameters:
event - the Entity Object event.
See Also:
EntityListener, EntityEvent

afterCommit

public void afterCommit(TransactionEvent event)
Handles events raised after a transaction has been committed. If the Application Module's "query-on-commit" flag is on, then all row sets that belong to this View Object are refreshed.

Override this method to perfom any subclass-specific behavior.

Specified by:
afterCommit in interface TransactionListener
Parameters:
event - the transaction event.
See Also:
TransactionListener

clearCache

public void clearCache()
Clears the View Object cache. This method can be called for resource conservation. Calling this method also forces an automatic reexecution of the query for all RowSets, which refreshes the cache from the database.

Specified by:
clearCache in interface ViewObject

afterRollback

public void afterRollback(TransactionEvent event)
Handles events raised after a transaction has been rolled back. All row sets that belong to this View Object are refreshed.

Specified by:
afterRollback in interface TransactionListener
Parameters:
event - the transaction event.
See Also:
TransactionListener

afterRemove

public void afterRemove(TransactionEvent event)
Handles events raised after rows have been removed.

Specified by:
afterRemove in interface TransactionListener
Parameters:
event - the transaction event.
See Also:
TransactionListener

beforeCommit

public void beforeCommit(TransactionEvent e)
Handles events raised before a transaction is committed.

Specified by:
beforeCommit in interface TransactionListener
Parameters:
e - the transaction event.
See Also:
TransactionListener

beforeRollback

public void beforeRollback(TransactionEvent e)
Handles events raised before a transaction is rolled back.

Specified by:
beforeRollback in interface TransactionListener
Parameters:
e - the transaction event.
See Also:
TransactionListener

isTransientTransactionListener

public boolean isTransientTransactionListener()
Tests whether this transaction listener is transient or permanent.

Transient listeners are automatically removed at the end of a transaction commit or rollback cycle; permanent listeners remain across these cycles.

Specified by:
isTransientTransactionListener in interface TransactionListener
Returns:
true if the listener is transient.

postChanges

public void postChanges(TransactionEvent e)
This method is not implemented in this class.

Specified by:
postChanges in interface TransactionPostListener
Parameters:
e - ignored.

isPostedToDB

public boolean isPostedToDB()
Specified by:
isPostedToDB in interface TransactionPostListener

setPostedToDB

public void setPostedToDB(boolean b)
Specified by:
setPostedToDB in interface TransactionPostListener

getTransPostHandle

public int getTransPostHandle()
Internal: Applications should not use this method.

Implements the getTransPostHandle method for the (TransactionPostListener) interface.

Transaction post handle is a handle identifying a row object in the transaction post listener list. View Objects do not have a transaction post handle, and thus returns -1.

Specified by:
getTransPostHandle in interface TransactionPostListener
Returns:
-1, which means no transaction post handle.

setTransPostHandle

public void setTransPostHandle(int hdl)
Internal: Applications should not use this method.

Implements the setTransPostHandle method for the transaction post listener (TransactionPostListener) interface.

Transaction post handle is a handle identifying a row object in the transaction post listener list. View Objects do not have a transaction post handle, and thus this method does nothing.

Specified by:
setTransPostHandle in interface TransactionPostListener
Parameters:
hdl - the transaction post handle.
Returns:
-1, which means no transaction post handle.

isTransientTransactionPostListener

public boolean isTransientTransactionPostListener()
Reports that this view object is not a transient transaction post listener.

Transient listeners are automatically removed at the end of a transaction post cycle; permanent listeners remain across post cycles. This property does not change.

Specified by:
isTransientTransactionPostListener in interface TransactionPostListener
Returns:
false

setListenToEntityEvents

public void setListenToEntityEvents(boolean b)
Sets the listen-to-entity-events flag.

This flag controls whether the View Object should listen to entity events or not. If false, the View Object and all its row sets will not receive events generated from changes to entity row data. This is useful for batch processing because suppressing events improves performance.

Parameters:
b - the new listen-to-entity-events flag.

findViewLinkAccessorVO

protected ViewObjectImpl findViewLinkAccessorVO(AssociationDefImpl assocDef,
                                                java.lang.String voName,
                                                ViewDefImpl vDef,
                                                ViewLinkDefImpl vlDef)

createViewLinkAccessorVO

protected ViewObjectImpl createViewLinkAccessorVO(AssociationDefImpl assocDef,
                                                  java.lang.String voName,
                                                  ViewDefImpl vDef,
                                                  ViewLinkDefImpl vlDef)

createViewLinkAccessorRS

protected ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl assocDef,
                                                  ViewObjectImpl accessorVO,
                                                  Row masterRow,
                                                  java.lang.Object[] values)

findViewLinkAccessor

public AttributeDef findViewLinkAccessor(ViewLink vl)
Finds the View Link accessor attribute.

Specified by:
findViewLinkAccessor in interface ViewObject
Parameters:
vl - the View Link whose accessor is sought.
Returns:
the attribute definition if it exists, or null.

getByKeyFinderRS

public ViewRowSetImpl getByKeyFinderRS()
Internal: Applications should not use this method.

Returns the most recently opened rowset for servicing retrieveByKey.

Returns:
the rowset.

retrieveByKey

protected Row[] retrieveByKey(ViewRowSetImpl rs,
                              Key key,
                              int maxNumOfRows)

retrieveByKey

protected Row[] retrieveByKey(ViewRowSetImpl rs,
                              Key key,
                              int maxNumOfRows,
                              boolean skipWhere)

getImplObject

public static ViewRowSetIteratorImpl getImplObject(java.lang.Object rsi)
Internal: Applications should not use this method.

Given a RowSetIterator interface, this routine returns the inner ViewRowSetIteratorImpl object.

Parameters:
rsi - the outer object that implements the RowSetIterator interface.
Returns:
the inner ViewRowSetIteratorImpl.

createXMLDefinition

public final java.lang.String createXMLDefinition(int depthCount)
Creates a DTD definition for the View Object and all its contents (including contained RowSets if depthCount is non-zero).

Parameters:
depthCount - represents to what level in the View Object the creation of the DTD definition should recurse.

writeXML

public Node writeXML(long options,
                     com.sun.java.util.collections.HashMap voAttrRules)
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
voAttrRules - 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,
                     XSLStylesheet xslt)
Writes the contents of this View Object by creating a new RowSet and rendering it in XML.

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

writeXML

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

writeXML

public final Node writeXML(int depthCount,
                           long options)
Writes the contents of this View Object by creating a new RowSet and rendering it in XML.

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

printXMLDefinition

protected java.lang.String printXMLDefinition(oracle.jbo.server.RowSetImpl rs,
                                              java.util.Hashtable allDefs,
                                              java.io.PrintWriter pw,
                                              int depthCount)
Calls RowImpl.printXMLDefinition(java.util.Hashtable, java.io.PrintWriter, int) to generate the definition for the rowset and all its contents (including contained rowsets if depthCount is non-zero).

Parameters:
rs - the rowSet for which you want to generate the DTD definition.
allDefs - a hashtable of predefined XML definitions passed from whatever calls this method.
pw - print writer into which the defnition is being printed.
depthCount - the number of child levels for which the DTD definition should be generated.

appendXMLElementNodes

protected void appendXMLElementNodes(oracle.jbo.server.RowSetImpl rs,
                                     Document xmlDoc,
                                     Node voNode,
                                     int depthCount,
                                     long options,
                                     com.sun.java.util.collections.HashMap voAttrMap)
Calls RowImpl.getXMLElementNodes to append row nodes to the given parent View Object node (voNode).

Parameters:
rs - the rowSet to which you want to append row nodes.
xmlDoc - the DTD
voNode - the View Object node that owns the rowSet.
depthCount - the number of child levels deep to append the row nodes.
options - a set of bit flags that will control the writeXML behavior.

appendXMLElementNodes

protected void appendXMLElementNodes(oracle.jbo.server.RowSetImpl rs,
                                     Document xmlDoc,
                                     Node voNode,
                                     int depthCount,
                                     long options)
Calls RowImpl.getXMLElementNodes to append row nodes to the given parent View Object node (voNode).

Parameters:
rs - the rowSet to which you want to append row nodes.
xmlDoc - the DTD
voNode - the View Object node that owns the rowSet.
depthCount - the number of child levels deep to append the row nodes.
options - a set of bit flags that will control the writeXML behavior.

readXML

public final void readXML(Element elem,
                          int depthCount,
                          XSLStylesheet xslt)
Given the document interface, finds the rowset Element and invokes JboXMLUtil.processAndReadXML(XMLInterface, org.w3c.dom.Element, int, oracle.xml.parser.v2.XSLStylesheet) to read in the data from the XML.

Note that if the XML contains modifications to row-keys, other RowSets for this object may not pick those changes up unless the rows are posted to the database. Call Transaction.postChanges() to sync up all RowSets for this View Object.

Specified by:
readXML in interface XMLInterface
Parameters:
elem - the element to which data should be read.
depthCount - represents to what level reading of data should recurse.
xslt -

readXML

public final void readXML(Element elem,
                          int depthCount)
Given the document interface, finds the rowset Element and invokes readFromXMLElementNode() to read in the data from the XML.

Note that if the XML contains modifications to row-keys, other RowSets for this object may not pick those changes up unless the rows are posted to the database. Call Transaction.postChanges() to sync up all RowSets for this View Object.

Specified by:
readXML in interface XMLInterface
Parameters:
elem - the element from which data should be read.
depthCount - represents to what level the reading should recurse.

readFromXml

public void readFromXml(XmlDocumentReader reader,
                        Element el)

getXMLElementTag

public java.lang.String getXMLElementTag()
Returns the XML element name for this View Object. If the custom property XML_ELEMENT is defined for this view definition, return that name. If it is not, return the name of the View Object.


getXMLRowElementTag

public java.lang.String getXMLRowElementTag()
Returns the XML element name for this View Object. If the custom property XML_ROW_ELEMENT is defined for this view definition, return that name. If it is not, return the name of the View Object.


updateRowSetFromXML

protected void updateRowSetFromXML(Element node,
                                   int depthCount,
                                   oracle.jbo.server.RowSetImpl rs)
Creates a key from the given element's sub-elements to find an existing row. If the row is found, it is updated with other attribute values. If the row is not found, it creates a new row, sets the attribute values and inserts the row in the rowset.

Parameters:
node - the node that corresponds to the row which is sought.
depthCount - represents to what level the updating should recurse.
rs - the rowSet in which the row should be found.
Throws:
ReadXMLException - when the read operation fails while reading the rows for this rowset. This exception may contain one exception per Row in this rowset.

checkPassivateViewAttributes

protected boolean checkPassivateViewAttributes()
Applications should override this method to indicate if all View Attribute (Transient, SQLDerived or Dynamic) needs to be passivated when this ViewObject is passivated. If true is returned, then this overrides the ViewAttribute property settings for XML passivation. By default, the framework returns false from this method so that only those View attributes which have custom property setting for PASSIVATE_TRANSIENT_VALUE are passivated.


isPassivatableTransientAttribute

protected final boolean isPassivatableTransientAttribute(ViewAttributeDefImpl voAttr)
Returns true if this Transient attribute should be passivated when the ViewObject data is being passivated. This method calls ViewObject.checkPassivateViewAttributes() to verify if VO is marked to passivate all transient attribute passivation. If so, this method returns true. This method returns true if Passivate flag is turned on in the metadata for this attribute. For backward compatibility if passivate flag is not set, but PASSIVATE_TRANSIENT_VALUE element is defined as a custom property with a value not equal to 'false' and XML_ELEMENT_NAME property is not '#hide', then this method returns true.


setPassivatableTransientAttribute

protected final void setPassivatableTransientAttribute(ViewAttributeDefImpl voAttr,
                                                       boolean flag)
Marks the given attribute def for this VO as passivatable. If the attribute definition does not belong to this ViewObject, then this method is a no-op.


passivateState

protected void passivateState(Document doc,
                              Element parent)
Allows subclasses to store custom data as XML-nodes under the given parent element, in the given document. The difference between this method and passivateState(ViewRowImpl, Document, Element) is that this method may be used to store custom data that does not depend upon the VO Iterator or RowSet state which may include:

By default the ViewObject does not store anything in this method. On activation, the ViewObject calls activateState(Element) with the parent element for the reverse operation.

Parameters:
doc - the XML document where the custom data will be stored.
parent - the parent element under which the custom data will be stored.

passivateState

protected void passivateState(ViewRowImpl currentRow,
                              Document doc,
                              Element parent)
Allows subclasses to store custom data as XML-nodes under the given parent element, in the given document. Specifies the current row for which the key has been passivated.

This method lets customized View Objects determine how they want to store private data for:

The only requirement is that this data should be stored under a child node under the parent element. Note that the data cannot be stored under the first child, because that is where default passivation routines always store the key.

The default implementation of this method stores transient row data and new row tracker data in the parent element. The default implementation should not be overriden.

On activation, the View Object calls activateState(Element) to notify the activation of ViewObject instance state and activateState(ViewRowImpl, Element) with the currentRow, and parent element to notify the activation of iterator state.

Parameters:
currentRow - the View Row for which the key has been passivated.
doc - the name of the XML document where the custom data will be stored.
parent - the name of the parent element under which the custom data will be stored.

passivateState

protected void passivateState(ViewRowSetImpl vrs,
                              ViewRowImpl currentRow,
                              Document doc,
                              Element parent)
Override this to store custom data as XML-nodes for the given ViewRowSetImpl.


passivateNewRowTracker

protected void passivateNewRowTracker(QueryCollection qc,
                                      RowFilterKey rf,
                                      Document doc,
                                      Element parent)
Stores the NewRow index and keys.


passivateTransients

protected void passivateTransients(ViewRowImpl currentRow,
                                   AttributeDefImpl[] attrs,
                                   Document doc,
                                   Element parent)
Deprecated. since 9.0.3.3 use passivateTransients(ViewRowSetImpl vrs...)

Stores the attributes from the given array for either just the current row or all the rows in this viewrowset into the given parent xml node. This method should be invoked from passivateState with a list of attributedefs as per the VO requirement. This method stores the rowkey, rowState(newRow or not) and the given set of attributes.


passivateTransients

protected void passivateTransients(ViewRowSetImpl vrs,
                                   ViewRowImpl currentRow,
                                   AttributeDefImpl[] attrs,
                                   Document doc,
                                   Element parent)
Stores the attributes from the given array for either just the current row or all the rows in the given ViewRowSet into the given parent xml node. This method should be invoked from passivateState with a list of attributedefs as per the VO requirement. This method stores the rowkey, rowState(newRow or not) and the given set of attributes.


activateNewRowTracker

protected void activateNewRowTracker(Element parent)
Deprecated. since 9.0.3.3

Advanced Internal method only.


activateNewRowTracker

protected void activateNewRowTracker(ViewRowSetImpl vrs,
                                     Element parent)
Advanced Internal method only. ReStores the newRowTracker array


handleActivatedRowNotFound

protected ViewRowImpl handleActivatedRowNotFound(Key k)
Applications should override this method and create a new row if they want to "own" management of a row that was not found during this VOs activation. This could occur when an updated row (transient values only) was removed from the database and the VO is being activated after that occurence.

Typically Applications will throw a RowNotFoundException for these cases based on their locking modes. By default this method simply prints a diagnostic warning.

Parameters:
k - Key object for the row that was not found during activation.

activateTransientAttribute

protected void activateTransientAttribute(ViewRowImpl row,
                                          Node transRow,
                                          AttributeDefImpl ad)
Override this method if activation of a transient attribute needs to also set/populate/ calculate some dependent attributes.


activateTransients

protected void activateTransients(AttributeDefImpl[] attrs,
                                  Element parent)
Deprecated. since 9.0.3.3 use activateTransients with ViewRowSetImpl

ReStores the attributes from the given array for either just the current row or all the rows in this viewrowset into the given parent xml node. This method should be invoked from passivateState with a list of attributedefs as per the VO requirement. This method stores the rowkey, and the given set of attributes.


activateTransients

protected void activateTransients(ViewRowSetImpl vrs,
                                  AttributeDefImpl[] attrs,
                                  Element parent)
ReStores the attributes from the given array for either just the current row or all the rows in the given ViewRowSet into the given parent xml node. This method should be invoked from passivateState with a list of attributedefs as per the VO requirement. This method stores the rowkey, and the given set of attributes.


activateState

protected void activateState(Element parent)
Allows subclasses to retrieve custom data from an XML-node under the given parent element. This method differs from activateState(ViewRowImpl, Element) in that the ViewObject RowSet and Iterator state are not restored when this method is invoked. Applications that define persistent, custom data which is dependent upon RowSet and/or Iterator state should extend passivateState(ViewRowImpl, Document, Element) and activateState(ViewRowImpl, Element) instead.

Parameters:
parent - element which could be null if nothing was passivated in it in passivateState

activateState

protected void activateState(ViewRowImpl currentRow,
                             Element parent)
Deprecated. since 9.0.3.3 use activateState(ViewRowSetImpl vrs...)

Allows subclasses to retrieve custom data from an XML-node under the given parent element. Specifies the current row for which the key has been passivated.

Parameters:
currentRow - the View Row for which the key has been passivated. This could be null if there is no current row or current row could not be activated.
parent - the name of the parent element under which the custom data resides. This could be null if there was no custom data stored for this VO in passivateState.

activateState

protected void activateState(ViewRowSetImpl vrs,
                             ViewRowImpl currentRow,
                             Element parent)
Deprecated. since 9.0.3.3 use activateState(ViewRowSetImpl vrs...)

Allows subclasses to retrieve custom data from an XML-node under the given parent element. Specifies the ViewRowSetImpl being activated along with current row for which the key has been passivated.

Parameters:
vrs - ViewRowSetImpl being activated.
currentRow - the View Row for which the key has been passivated. This could be null if there is no current row or current row could not be activated.
parent - the name of the parent element under which the custom data resides. This could be null if there was no custom data stored for this VO in passivateState.

readRowXML

public void readRowXML(Element rowElt,
                       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

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 \/*+ *\/ columns... For expert mode queries, this hint is appended in the outer Select like: SELECT \/*+ *\/ * FROM ()

Specified by:
setQueryOptimizerHint in interface ViewObject

getQueryOptimizerHint

public java.lang.String getQueryOptimizerHint()
Returns any Query Optimizer Hint set for this ViewObject or for it's definition object.

Specified by:
getQueryOptimizerHint in interface ViewObject

dumpQCs

public void dumpQCs()
Internal: Applications should not use this method.

Debugging aid to dump info for QCs.


findRowInQCs

public Row findRowInQCs(java.lang.Object[] rowFilterValues,
                        Key key,
                        java.lang.Object rowHandle)
Internal: Applications should not use this method.


activateIteratorState

public void activateIteratorState(Element node,
                                  boolean clearIteratorState)
Internal: Applications should not use this method.

Used by the framework to force an iterator activation. Applications should extend #activateIteratorState(ViewRowImpl, Element).


activateCurrentRow

protected ViewRowImpl activateCurrentRow(ViewRowSetIteratorImpl vrsi,
                                         ViewRowSetImpl vrs,
                                         Key key)
Override this to provide custom current row lookup. Apps may need to implement this method in cases where expert mode query or full-query is used for a VO and the query has where-clause with bindparameters built into it and this VO is not executed but has inserted rows. In this case, since the VO is not passivated, there are no bind params passivated and on activation findByKey will fail to find the current row as the VO does not have bind parameters.

Override this method and use another VO to fetch an equivalent row and add it to the given ViewRowSet. The caller activation routine will set the row as current.


prepareForActivation

protected void prepareForActivation(Element amNode)
Override this method to activate custom data in the ViewObject from this VO's xml node. This data would most likely be passivated in the overridden prepareForPassivation(). This method is called before any VO settings are activated.


prepareForPassivation

protected void prepareForPassivation(Document out,
                                     Element parent)
Override this method to passivate custom data in the ViewObject, before any ViewObject settings are passivated.

Parameters:
out - Document in which to create xml nodes.
parent - Element node under which this VO's data is being passivated.

resetSession

protected void resetSession()
BC4J invokes this method when a ViewObject is being reset for potential reuse by another client session. Custom applications may extend this method to clean up custom ViewObject state that was specific to the last session to use this ViewObject. Examples of custom session state may be a ViewObject where clause, order by clause, etc. public void resetSession() { super.resetSession(); if (getWhereClause() != null) { setWhereClause(null); } }

See Also:
ApplicationModuleImpl.resetState(boolean)

setPassivationEnabled

public void setPassivationEnabled(boolean enabled)
Advanced method: Enables/disables passivation for this ViewObject instance. By default, passivation is enabled for all application ViewObject(s). In order to optimize passivation/activation performance, advanced applications may disable passivation for some "stateless" ViewObject(s). Examples of "stateless" ViewObject(s) may include a list validator.


isPassivationEnabled

public boolean isPassivationEnabled()
Advanced method: Checks if passivation is enabled for this ViewObject. By default, passivation is enabled for all application ViewObject(s).

See Also:
setPassivationEnabled(boolean)

getFilteredRows

public Row[] getFilteredRows(RowQualifier qualifier)

getFilteredRowsInRange

public Row[] getFilteredRowsInRange(RowQualifier qualifier)

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.

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

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