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

E10653-07

oracle.jbo.server
Class ViewObjectImpl

java.lang.Object
  extended by oracle.jbo.common.NamedObjectImpl
      extended by oracle.jbo.server.NamedObjectImpl
          extended by oracle.jbo.server.ComponentObjectImpl
              extended by oracle.jbo.server.ViewObjectImpl
All Implemented Interfaces:
java.util.EventListener, ViewCriteriaClauseBuilder, ViewCriteriaManagerOwner, ViewObjectDynAttr, WSRowSetIteratorMarshaller, WSRowSetMarshaller, ComponentObject, ExprWrappable, GenericHints, NavigatableRowIterator, OperationContainer, Properties, RowIterator, RowMatchBindValueSupplier, RowNavigationListener, RowSet, RowSetIterator, RowSetListener, AttributeDependencyManager, EntityListener, TransactionListener, TransactionPostListener, StructureDef, VariableManagerOwner, VariableManagerOwnerBase, ViewCriteriaManager, ViewObject, XMLInterface
Direct Known Subclasses:
DCDataVO, DSViewObjectImpl, FinderViewImpl, PlaceholderVOImpl, ViewObjectOnRowSets

public class ViewObjectImpl
extends ComponentObjectImpl
implements ViewObject, EntityListener, RowSetListener, TransactionListener, TransactionPostListener, WSRowSetMarshaller, WSRowSetIteratorMarshaller, ViewObjectDynAttr, ViewCriteriaManager, ViewCriteriaManagerOwner, RowMatchBindValueSupplier, ViewCriteriaClauseBuilder, AttributeDependencyManager

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
           
protected static java.lang.String DISC_TAG
           
protected static java.lang.String DYN_ATTRS
           
protected static java.lang.String DYN_ATTRS_ENTRY
           
protected static java.lang.String DYN_ATTRS_EXPR
           
protected static java.lang.String DYN_ATTRS_NAME
           
protected static java.lang.String DYN_ATTRS_TYPE
           
protected static java.lang.String EFFDT_MODE
           
protected static java.lang.String ENT_HDL_TRACKER
           
protected static java.lang.String ENT_REF_INDEX
           
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().
static java.lang.String INTERNAL_EXPR_VALUE_OVERRIDES
           
protected  java.lang.String mAssocClause
           
protected  java.lang.String mAssocFromClause
           
protected  java.util.ArrayList mAssocRefs
           
protected  ViewAttributeDefImpl[] mAttrDefs
           
protected  java.util.HashMap mAttrDefsTab
           
protected  boolean mAutoPostChanges
           
protected  int[] mChangedAttrIndices
           
protected  int mChgAttrIndUseCount
           
static int mDefaultMaxActiveNodes
           
static int mDefaultMaxRowsPerNode
           
protected  java.util.Map mDefaultRowSetMap
           
protected  int mDynAttrOffset
           
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
           
static java.lang.String PROPERTY_DEFERRED_ESTIMATED_ROWCOUNT
          A custom property name that indicates if this VO should defer calling estimatedRowCount in the 'getDeferredEstimatedRowCount' method.
protected static java.lang.String QC_TAG
           
protected static java.lang.String TRANSIENT_DATA_ROWTAG
           
 
Fields inherited from class oracle.jbo.common.NamedObjectImpl
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX
 
Fields inherited from interface oracle.jbo.ViewObject
IMAGE_LOC, QUERY_MODE_SCAN_DATABASE_TABLES, QUERY_MODE_SCAN_ENTITY_ROWS, QUERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS, QUERY_MODE_SCAN_VIEW_ROWS, QUERY_MODE_SKIP_WHERE, QUERY_TIMEOUT_WAIT_FOREVER, XML_ELEM_PASSIVATE_TRANSIENT
 
Fields inherited from interface oracle.jbo.RowSet
COPY_OPT_ALL_ROWS, COPY_OPT_LIMIT_RANGE, FORWARD_ONLY, RANGE_PAGING, RANGE_PAGING_AUTO_POST, RANGE_PAGING_INCR, SCROLLABLE
 
Fields inherited from interface oracle.jbo.RowIterator
ITER_MODE_LAST_PAGE_FULL, ITER_MODE_LAST_PAGE_PARTIAL, SLOT_BEFORE_FIRST, SLOT_BEYOND_LAST, SLOT_DELETED, SLOT_VALID
 
Fields inherited from interface oracle.jbo.XMLInterface
XML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT, XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE, XML_PASSIVATION_USE
 
Fields inherited from interface oracle.jbo.GenericHints
PROPERTY_LABEL, PROPERTY_LABEL_PLURAL, PROPERTY_TOOLTIP
 
Fields inherited from interface oracle.jbo.ViewCriteriaManager
DFLT_VIEW_CRITERIA_NAME, IMPLICIT_VIEW_CRITERIA_NAME, QUICKSEARCH_VIEW_CRITERIA_NAME
 
Constructor Summary
ViewObjectImpl()
          Constructs a new View Object.
ViewObjectImpl(java.lang.String name, ViewDefImpl voDef)
          Constructs a new View Object.
 
Method Summary
protected  java.util.List _internal_dbg_debug_data()
          framework use only
protected  ViewRowImpl activateCurrentRow(ViewRowSetIteratorImpl vrsi, ViewRowSetImpl vrs, Key key)
          Override this to provide custom current row lookup.
protected  void activateDynamicAttributeDefs(Node dyns)
           
 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.
 AttributeDef addDynamicAttributeWithType(java.lang.String attrName, java.lang.String javaTypeName, java.lang.String transientExpression)
           
 void addForwardDependency(java.lang.String attrName, java.lang.String depName)
           
 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.
 void addQueryMode(int queryMode)
          Adds query mode for the view object.
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.
 boolean adjustERCWithChangedRows()
           
 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.
 void appendViewCriteria(ViewCriteria criteria)
          Appends this viewcriteria to the existing list of criterias.
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, java.util.HashMap voAttrMap)
          Calls RowImpl.getXMLElementNodes to append row nodes to the given parent View Object node (voNode).
protected  boolean applyBindVariableForCriteria(ViewCriteria criteria, Variable variable, java.lang.Object variableValue)
          Subclasses may override to return false when a bind variable defined for this criteria or one of it's contained items should not be applied to the statement object during query because some custom code disabled the criteria fragment that would have used this given bind variable.
 void applyPersonalization()
           
 void applyViewCriteria(ViewCriteria criteria)
          Applies the view criteria to this view object.
 void applyViewCriteria(ViewCriteria criteria, boolean bAppend)
          Applied the view criteria to this view object.
 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 bindFinderRS(java.lang.Object[] oParams, ViewRowSetImpl finderRS, boolean inclEffDateVals, boolean forceWhereVars)
           
protected  void bindParametersForCollection(QueryCollection qc, java.lang.Object[] params, java.sql.PreparedStatement stmt)
           
protected  void bindRangePagingParams(java.sql.PreparedStatement stmt, int nextParamIndex, 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  int buildEffectiveDateFromClauseFragment(java.lang.StringBuffer fromClause, int noUserParams)
          This method is invoked in a Join VO scenario and ANSI Join Syntax is being followed.
protected  int buildEffectiveDateWhereClauseFragment(java.lang.StringBuffer effDtClause, int noUserParams)
          Generates the Effective date filter clause fragment.
protected  java.lang.String buildFromClause()
           
 Key buildKey(java.lang.Object[] values)
           
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 buildQuery(int noUserParams, boolean forRowCount, java.lang.String selClause, java.lang.String fromClause, java.lang.String whereClause, int subQueryLevel)
           
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  java.lang.String buildSelectClause()
           
 java.lang.String buildSubquery(AttributeDef[] attrsToSelect, java.lang.String whereClause, AttributeDef accessor, ViewCriteria nestedVC)
           
 CriteriaClauses buildViewCriteriaClauses(ViewCriteria vc)
          This method is used by the framework to generate a query clause for a particular view criteria.
protected  boolean buildWhereClause(java.lang.StringBuffer sqlBuffer, int noUserParams)
          Builds the WHERE clause part of the query and adds it into the string buffer.
 boolean cancelQuery()
          Cancels a running query.
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 clearViewCriterias()
          Clear all view criteria, both applied and unapplied help by this manager
 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.
protected  ViewRowImpl createAndInitRowForCollection(java.lang.Object qc, AttributeList initVals)
           
 RowSet createDetailRowSet(java.lang.String rsName, java.lang.String linkDefName)
          Creates a detail Row Set.
protected  ViewObjectImpl createFinderVO(java.lang.String suffix)
           
 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.
protected  ViewRowImpl createInstanceWithEntities(int[] eoIndices, EntityImpl[] entities, ViewRowSetImpl viewRowSet, AttributeList attrValList)
           
 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 iqc, 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.
protected  VariableValueManager createVariableValueManager(VariableManagerOwnerBase owner, VariableManager[] varMgrParents)
          Internal: Applications should not use this method. override and call the RowSet version of the creator.
protected  VariableValueManager createVariableValueManagerForRS(RowSet owner, VariableManager[] varMgrParents)
          Internal: Applications should not use this method. Framework Subclasses may use this to creaet custom subclasses of VariableValueManagerImpl
protected  ViewRowSetImpl createViewAccessorRS(ViewAccessorDef accessorDef, Row masterRow, java.lang.Object[] values, boolean addRSToMasterRow)
           
 ViewCriteria createViewCriteria()
          Creates a new view criteria object for this View Object.
protected  void createViewLinkAccessor(java.lang.String accrName, java.lang.String voName, ViewLink vl, ViewLinkDefImpl vlDef, ViewObject master, ViewObject detail, java.lang.Class javaType)
          Internal: Applications should not use this method.
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)
           
protected  ViewRowSetImpl createViewLinkScanBaseRS(AssociationDefImpl assocDef, ViewObjectImpl accessorVO, Row masterRow)
           
protected  ViewRowSetImpl createViewRowSet(java.lang.String rsName, boolean isDefaultRS, boolean isAccessorRS, boolean passivateRS)
           
 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).
 void criteriaChanged(ViewCriteria vc)
          The criteria manager can track changes to applied view criteria.
 void criteriaSelReqBindVarsChanged(ViewCriteria vc)
           
 RowSet deepCopy(java.util.HashMap voAttrMap, long options)
          This method delegates to the default RowSet.
 void defineNamedWhereClauseParam(java.lang.String name, java.lang.Object defaultValue, int[] indices)
          Defines a named bind variable to use with the view object's where-clause.
 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 executeQueryForActivation(ViewRowSetImpl vrs, boolean isEmptyDetail)
          Deprecated. Internal use only.
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.
 KeyDef findAltKeyDef(java.lang.String keyName)
           
 void findAndSetCurrentRowByKey(Key key, int rangeIndex)
           
protected  EntityImpl findAssociatedEntity(QueryCollection qc, ViewRowImpl viewRow, EntityImpl[] entities, int srcEntityIndex, AssociationReference assocRef, java.lang.Object[] values)
          When a query collection of a join VO needs to find a detail entity row related to the master entity row, related through an association, this method is invoked.
 AttributeDef findAttributeDef(java.lang.String name)
          Finds a named attribute definition.
 RowIterator findByAltKey(java.lang.String keyName, Key key, int maxNumOfRows, boolean skipWhere)
          Same as RowIterator.findByKey(Key, int) with a few extra functionalities.
 Row[] findByEntity(int eRowHandle, int maxNumOfRows)
          Finds and returns View rows that use the Entity row, identified by the Entity row handle, eRowHandle.
 Row[] findByKey(Key key, int maxNumOfRows)
          Finds and returns View rows that match the specified key.
 Row[] findByKey(Key key, int maxNumOfRows, boolean skipWhere)
          If skipWhere is true, then do not use the where-clause fragments associated with this ViewObject if a query is used to retreieve the matching row during this findByKey operation on this ViewObject.
 RowIterator findByViewCriteria(ViewCriteria criteria, int maxNumOfRows, int queryMode)
          Finds and returns View rows that match the specified View Criteria.
protected  RowIterator findByViewCriteriaForViewRowSet(ViewRowSetImpl vrs, ViewCriteria criteria, int maxNumOfRows, int queryMode, Variable[] vars, java.lang.Object[] values)
           
 RowIterator findByViewCriteriaWithBindVars(ViewCriteria[] criterias, int maxNumOfRows, int queryMode, Variable[] vars, java.lang.Object[] values)
           
 RowIterator findByViewCriteriaWithBindVars(ViewCriteria criteria, int maxNumOfRows, int queryMode, Variable[] vars, java.lang.Object[] values)
           
 RowIterator findInCacheByAltKey(java.lang.String keyName, Key key, int maxNumOfRows)
           
 Row[] findInCacheByKey(Key key, int maxNumOfRows)
           
 ListBindingDef findListBindingDef(java.lang.String lbName)
          Return listbinding definition if defined in this ViewObject (or in the entity definitions for entities that this ViewObject constitutes of).
protected  ViewObject findOrCreateLocalViewObject(java.lang.String usageName)
          Find or create the local view instance from the local view usage name.
protected  ViewObject findOrCreateLocalViewObject(java.lang.String usageName, java.lang.String voName)
          Find or create the local view instance from the local view usage name.
 java.util.Set<java.lang.String> findPrimaryKeyColumns(java.lang.String tableName)
           
 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.
 RowIterator findRowsMatchingCriteria(ViewCriteria criteria, int maxNumOfRows)
          Performs findByViewCriteria(criteria, maxNumOfRows, QUERY_MODE_SCAN_DATABASE_TABLES & QUERY_MODE_SCAN_VIEW_ROWS);
 ViewAccessorDef findViewAccessorDef(java.lang.String name)
           
 ViewDefImpl findViewDefFromDiscrVals(java.sql.ResultSet resultSet, AttributeList initValues)
           
 ViewDefImpl findViewDefFromDiscrVals(java.sql.ResultSet resultSet, AttributeList initValues, EntityImpl[] entities)
           
 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.
 void forceExecuteQueryOfSharedVO()
           
 byte getAccessMode()
           
protected  java.util.Enumeration getAllCachedQueryCollections()
           
 Row[] getAllRowsInRange()
          Returns an array of all rows in the iterator's range.
 java.lang.String[] getAllViewCriteriaNames()
          Returns a list of both applied and unapplied view criterias managed by this object.
 ViewCriteria[] getAllViewCriterias()
          Returns a list of both applied and unapplied view criterias managed by this object.
 AttributeDef[] getAltKeyAttrDefs(java.lang.String keyName)
           
 ApplicationModule getApplicationModule()
          Returns the application module to which this View Object belongs.
protected  ApplicationModule getApplicationModuleForLocalViewObject()
           
 ViewCriteria[] getApplyAllViewCriterias(int criteriaMode, boolean getAllReqdVC)
           
 java.lang.String[] getApplyJoinedViewCriteriaNames()
           
 java.lang.String[] getApplyViewCriteriaNames()
           
 ViewCriteria[] getApplyViewCriterias(int criteriaMode)
          Return a list of applied view criteria that have the mode passed in the argument turned on.
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).
 java.lang.String[] getAvailableViewCriteriaNames()
          Returns a list of view criteria names that are unapplied and managed by this object
 java.util.HashSet<java.lang.String> getBackwardDependencies(java.lang.String attrName)
           
 java.util.List getBackwardDependencyAttributes(java.lang.String attrName)
           
 int getBindingStyle()
          Returns the binding style.
 java.util.HashMap getBindValsForSqlGen()
           
 ViewRowSetImpl getByKeyFinderRS()
          Internal: Applications should not use this method.
protected  QueryCollection getCachedQueryCollection(RowFilter rowFilter)
          Internal: Applications should not use this method.
 int getCalculatedAttributeCount()
          Counts the number of "calculated" attributes.
protected  java.sql.CallableStatement getCallableStatement()
          generate CallableStatement for PLSQL view object.
 long getCappedQueryHitCount(ViewRowSetImpl viewRowSet, Row[] masterRows, long oldCap, long cap)
          This method executes a count query and returns the number of rows that could end up in the rowset.
 long getCappedRowCount(long cap)
          This method executes a count query and returns the number of rows that could end up in the rowset.
 SvcMsgIteratorState getCliIteratorState()
           
 java.lang.String getColumnNameForQuery(int index)
           
 CriteriaAdapter getCriteriaAdapter()
          Return a custom CriteriaAdapter implementation to generate where clause for ViewCriteria.
 AttributeHints getCriteriaItemAttributeHints(ViewCriteriaItem vci)
          By default return null.
 java.lang.String getCriteriaItemClause(ViewCriteriaItem vci)
          Interpret the given ViewCriteriaItem and generate a where clause fragment for the ViewCriteriaItem.
 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.
 SortCriteria[] getDBSortCriteria()
           
 DBTransaction getDBTransaction()
          Gets the transaction within which this View Object operates.
 DefObject getDef()
          Internal: Applications should not use this method.
 byte getDefaultAccessMode()
           
 int getDefaultRangePagingCacheFactor()
           
 int getDefaultRangeSize()
           
 ViewRowSetImpl getDefaultRowSet()
          Internal: Applications should not use this method.
protected  ViewRowSetImpl getDefaultRowSetInternal()
           
protected  java.lang.Boolean getDeferEstimatedRowCountProperty()
           
 long getDeferredEstimatedRowCount()
          If this ViewObject is marked to not perform the estimatedRowCount query, then return -1 until either the estimatedRowCount is called and the count is known or the RowSet is fetched completely in which case the actual row count is known.
 java.lang.String getDefFullName()
          Returns the 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.
 java.lang.Object[] getForeignKeyValues(EntityImpl entity, oracle.jbo.server.EntityAssociationReference assocRef)
           
 java.util.HashSet<java.lang.String> getForwardDependencies(java.lang.String attrName)
           
 java.util.List getForwardDependencyAttributes(java.lang.String attrName)
           
 java.lang.String getFromClause()
           
 int getFromClauseFlags()
           
 java.lang.String getFullLoggingName()
          This method will return [view def name]view full name"
 int getFullSqlMode()
           
 java.lang.String getImageLoc(boolean bOpen)
           
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.
 ListBindingDef[] getListBindingDefsInternal()
          Deprecated. Use lookupListBindingDef instead.
protected  int[] getLockParticipants()
          Internal: Applications should not use this method.
protected  java.util.ArrayList getMasterKeyValues(AssociationDefImpl assocDef)
          Gets a list of distinct key values from the rows in this master VO, by enumerating through its query collections.
 RowSetIterator[] getMasterRowSetIterators()
          Returns an array of all master row set iterators for this row set.
 int getMaxFetchSize()
          Gets the maximum row fetch size.
 java.lang.Object getNamedWhereClauseParam(java.lang.String name)
          Gets the value of a named where-clause parameter for this row set.
 AttributeList getNamedWhereClauseParams()
          Gets the bind name, value pair of all Named bind variables.
 Row[] getNextRangeSet()
          Gets the next set of rows in the range.
 OperationDefinitionsImpl getOperationDefinitions()
          Deprecated.  
 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()
          This method is equivalent to getKeyAttributeDefs().
 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.
 java.lang.String getQueryHint()
           
 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)
           
 int getQueryMode()
          Gets the current query mode of this view object.
 java.lang.String getQueryOptimizerHint()
          Returns any Query Optimizer Hint set for this ViewObject or for it's definition object.
 int getQueryTimeOut()
          Returns the current query time out value.
 int getRangeIndexOf(Row row)
          Returns the range index of a given row.
protected  int getRangePageStartForCollection(java.lang.Object qc)
           
 int getRangePagingCacheFactor()
           
 int getRangeSize()
          Returns the range size of the iterator.
 int getRangeStart()
          Returns the absolute row index of the first row in the range.
 ViewCriteria getReqdVC()
          Deprecated. use getRequiredViewCriteria()
 ViewCriteria getRequiredViewCriteria()
          This method returns a reference to the required view criteria if one exists on this View Object.
 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.
 java.util.Comparator getRowComparator()
           
 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.
protected  long getRowLimit()
          A limit may be applied on the number of rows in a query collection.
 RowMatch getRowMatch()
          Gets the in-memory filter (RowMatch) for the view object.
 java.lang.Object getRowMatchBindValue(Row row, java.lang.String varName)
           
 RowMatch getRowMatchFromViewCriteria()
           
 OperationDefinitionsImpl getRowOperationDefinitions()
          Deprecated.  
 java.lang.String getRowProxyClassName()
          Internal: Applications should not use this method.
 RowQualifier getRowQualifier()
          Deprecated. since 10.0.1.3 use getRowMatch().
 RowSet getRowSet()
          Returns the View Object as a RowSet object.
 ViewRowSetImpl getRowSetForSqlGen()
           
 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.
 java.util.List<ViewRowSetImpl> getRowSetsInternal()
           
 AttributeDef[] getScanRowFilterAttributeDefs()
           
 java.lang.String getSelectClause()
           
 int getSelectClauseFlags()
           
 long getSignature()
          Internal: Applications should not use this method. Only for use in Object marshalling for remote tiers.
 java.lang.String getSortBy()
           
 SortCriteria[] getSortCriteria()
           
 StructureDef getSubclassDef(ViewDefImpl viewDef)
           
 StructureDef getSubclassDefFromStructureDef(StructureDef viewDef)
          Strictly Internal: Applications should not use this method.
 java.lang.String[] getSubstitutedDefNames()
          Returns an array of fully qualified view definition names that are substituted by this view object's definition.
 java.lang.Object getSyncLock()
          Gets the locking object for this Row Set Iterator.
 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.
 java.util.ArrayList getViewAccessorDefsInternal()
          Deprecated. Use lookupViewAccessorDef instead.
 ViewAttributeDefImpl[] getViewAttributeDefImpls()
          Internal: Applications should not use this method.
 ViewCriteria getViewCriteria()
          Gets the view criteria for this View Object.
 ViewCriteria getViewCriteria(java.lang.String name)
          Returns a reference to the view criteria with a specific name if it is found.
 java.lang.String getViewCriteriaClause()
          Deprecated. since 10.0.3. use getViewCriteriaClause(boolean) instead.
 java.lang.String getViewCriteriaClause(boolean forQuery)
          Generates the WHERE clause expression from the applied view criterias.
 ViewCriteriaManager getViewCriteriaManager()
           
 ViewCriteriaManager getViewCriteriaManagerInternal()
           
protected  ViewDefImpl getViewDef()
          Internal: Applications should not use this method.
protected  ViewLinkAccessorInfo getViewLinkAccessorInfo()
           
protected  java.util.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 owns this row set.
 java.lang.String getWhereClause()
          Gets the query's WHERE clause.
 int getWhereClauseFlags()
           
 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 hideAttributeDef(java.lang.String attrName)
           
protected  void initFromDef()
           
 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 isAttributeKey(AttributeDef attrDef)
           
 boolean isAutoPostChanges()
          Indicates whether auto-post-changes is enabled or not.
 boolean isAutoRefreshEnabled()
          Auto Refresh for a View Object is true if it is enabled in the View Definition and belongs to a Shared Application Module.
protected  boolean isCollectionPresent(RowFilter rowFilter)
           
protected  boolean isDefaultAssocConsistent()
           
 boolean isDefaultRowSet()
          Internal: Applications should not use this method.
 boolean isDynamicAttribute(int index)
          Indicates whether an attribute is dynamic.
 boolean isDynamicAttribute(java.lang.String name)
          Indicates whether the named attribute is dynamic.
 boolean isEffectiveDated()
          This method returns trueif this view object instance is effective dated.
protected  boolean isEntityReferenceSelected(EntityReference eRef)
          Tell whether the given entity reference has been selected (ie.
 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.
protected  boolean isMasterKeyValues(java.lang.Object[] paramValues, int bindingStyle)
           
 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 isRuntimeSQLGeneration()
           
 boolean isSelectAllAttributes()
           
 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.
 KeyDef lookupAltKeyDef(java.lang.String keyName)
           
 AttributeDef lookupAttributeDef(java.lang.String name)
          Finds a named attribute definition.
 ListBindingDef lookupListBindingDef(java.lang.String lbName)
          Return listbinding definition if defined in this ViewObject (or in the entity definitions for entities that this ViewObject constitutes of).
 ViewAccessorDef lookupViewAccessorDef(java.lang.String vaName)
           
protected  void markQueryCollectionDirty(QueryCollection qc, boolean isDirty)
          Given a query collection qc and a flag isDirty, explicitly sets the query collection's dirty status.
 java.lang.Object marshalListBindingDefs(java.lang.String subTypeName)
          Internal: Applications should not use this method.
 void navigated(NavigationEvent event)
          Invoked when the current-row designation changes.
 boolean needsRefresh()
           
 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(QueryCollection qc, Row row, int[] attrIndices, boolean markQCDirty)
           
protected  void notifyRowUpdated(QueryCollection qc, Row row, int[] attrIndices, UpdateEvent rowUpdateEvent)
           
protected  void notifyRowUpdated(ViewRowSetImpl vrs, Row[] viewRows, int[] attrIndices)
           
protected  void notifyRowUpdated(ViewRowSetImpl vrs, Row[] viewRows, int[] attrIndices, UpdateEvent updateEvent)
          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 onDatabaseChangeNotification(QueryCollection qc, java.util.EventObject evt)
          This method is invoked when the database notifies that the collection of rows in the qc has changed.
protected  void passivateDynamicAttributeDef(java.util.ArrayList dal, Document doc, Element parent)
           
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.
 void preFetchRowsByKeys(AttributeDef[] keyAttrs, Key[] keys)
           
 void preFetchRowsByKeys(AttributeDef[] keyAttrs, Key[] keys, Row parentRow)
           
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.
 void prepareRowSetForQuery(ViewRowSetImpl vrs)
           
 void prepareRowSetForQuery(ViewRowSetImpl vrs, Row[] masterRows)
          This method is invoked when ViewRowSetImpl::execute() is called.
 void prepareVOForQuery()
          Prepare view object for build query.
 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).
protected  void processDatabaseChangeNotification(QueryCollection qc)
          This method is invoked during the application's lifecycle determines that it is ready to process queued notifications.
protected  void processNewSelectSet()
           Activate the attributes selected in calls to selectAttributeDefs, unselectAttributeDefs.
protected  void processSortCriteria()
           
 void putViewCriteria(java.lang.String name, ViewCriteria vc)
          Add a view criteria to be managed by this object
protected  boolean qualifiesRowFilter(QueryCollection qc, java.lang.Object[] values, int filterOffset)
           
 void rangeRefreshed(RangeRefreshEvent event)
          Invoked when the range changes.
 void rangeScrolled(ScrollEvent event)
          Invoked when the range is scrolled.
 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)
           
 void refreshWhereClauseParams()
           
protected  ADFDatabaseChangeListener registerDatabaseChangeListener(QueryCollection qc, java.sql.Connection conn, java.sql.Statement stmt)
          This methood is invoked by the Query Collection to register for database change notifications.
protected  void releaseUserDataForCollection(java.lang.Object qc, java.lang.Object data)
           
 void remove()
          Removes this View Object from its containing application module.
 boolean removeApplyViewCriteriaName(java.lang.String name)
          Unapplied the view criteria if it is applied.
 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 removeNamedWhereClauseParam(java.lang.String name)
          Removes a named where-clause parameter.
 void removeRowHandle(java.lang.Object hdl)
          Internal: Applications should not use this method.
protected  void removeRowSet(ViewRowSetImpl rs)
           
 ViewCriteria removeViewCriteria(java.lang.String name)
          Removes the view criteria from this manager.
 void reset()
          Resets the iterator.
 void resetCriteria(ViewCriteria vc)
          Resets a view criteria to the state as defined in the View Definition.
 void resetExecuted()
          This method delegates to the default RowSet.
 void resetSelectedAttributeDefs()
          Calls resetSelectedAttributeDefs(false).
 void resetSelectedAttributeDefs(boolean forceSelectAllAttributes)
          Does not select or unselect any attributes, but clears the private member variable of ViewObjectImpl that holds the attributes that should be selected.
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  Row[] retrieveByKey(ViewRowSetImpl rs, java.lang.String keyName, Key key, int maxNumOfRows, boolean skipWhere)
           
 void rowDeleted(DeleteEvent event)
          Invoked when a row has been deleted.
 void rowInserted(InsertEvent event)
          Invoked when a row has been inserted.
protected  boolean rowQualifies(ViewRowImpl vr)
          Evaluates whether the view row qualifies the view object's row match and in-memory filter view criteria.
 void rowUpdated(UpdateEvent event)
          Invoked when an attribute of the row has been changed.
 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 selectAttributeDefs(java.lang.String[] attrNameArray)
          Does not select or unselect any attributes, but adds the attributes in attrNameArray to a private member variable of ViewObjectImpl.
 void setAccessMode(byte flag)
          Constrains the row access based on the following settings:
 void setApplyJoinedViewCriteriaNames(java.lang.String[] names)
           
 void setApplyViewCriteriaName(java.lang.String name)
          Apply the view criteria name passed as the argument.
 void setApplyViewCriteriaName(java.lang.String name, boolean bAppend)
          Apply the view crtieria name passed as the argument.
 void setApplyViewCriteriaNames(java.lang.String[] names)
          Apply a set of view criteria names passed as the argument.
 void setAssociationConsistent(boolean isConsistent)
          Sets the association-consistent flag for this row set.
 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.
 void setCurrentUnionViewCriteriaName(java.lang.String vcName)
           
 void setDBSortCriteria(SortCriteria[] sortCriteria)
          Set declarative sort criteria for database queries.
 void setDefaultAccessMode(byte b)
           
protected  void setDefaultAssocConsistent(boolean isEquiJoin)
           
 void setDefaultRangePagingCacheFactor(int i)
           
 void setDefaultRangeSize(int i)
           
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 setFromClause(java.lang.String fromClause)
           
 void setFromClauseFlags(int flags)
           
 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 setNamedWhereClauseParam(java.lang.String name, java.lang.Object value)
          Sets the value of a named where-clause parameter for this row set.
 void setNamedWhereClauseParams(AttributeList attrlist)
          Sets a specified bind name, value pair.
 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 setQueryHint(java.lang.String queryHint)
           
 void setQueryMode(int queryMode)
          Sets query mode for the view object.
 void setQueryOptimizerHint(java.lang.String hintText)
          If this ViewObject does not have an expert mode query, then this hint is added to the select clause of the SQL for this ViewObject before the columns are listed e.g., SELECT \/*+ *\/ columns...
 void setQueryTimeOut(int queryTimeOut)
          Sets the query time out value for the view object.
 void setRangePagingCacheFactor(int f)
           
 int setRangeSize(int size)
          Sets the range size for the iterator.
 int setRangeStart(int start)
          Positions the range.
 void setReqdVC(ViewCriteria vc)
          Deprecated. use setRequiredViewCriteria()
 void setRequiredViewCriteria(ViewCriteria vc)
          Setting a view criteria as required will enforce the criteria whenever the view object's query is executed.
protected  void setResultSetForCollection(java.lang.Object qc, java.sql.ResultSet rs)
           
 void setRowFilterValues(java.lang.Object[] rowFilterValues)
           
 void setRowMatch(RowMatch rowMatch)
          Sets an in-memory filter (RowMatch) for the view object.
protected  void setRowMatchFromViewCriteria(RowMatch rowMatch)
           
 void setRowQualifier(RowQualifier rowQualifier)
          Deprecated. since 10.0.1.3 use setRowMatch(oracle.jbo.RowMatch).
 void setRowValidation(boolean flag)
          Sets the validation flag on this iterator.
 void setSelectClause(java.lang.String selClause)
           
 void setSelectClauseFlags(int flags)
           
 void setSortBy(java.lang.String sortBy)
          Specify a clause to perform in-memory sorting.
 void setThrowOnListBindingMismatch(boolean b)
          Internal: Applications should not use this method.
 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 setWhereClauseFlags(int flags)
           
 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.
 boolean shouldPutJoinConstraintInWhereClause()
           
 void showCursorUsage(java.io.Writer out)
          Internal: Applications should not use this method.
 void skipNamedWhereClauseParam(java.lang.String name)
          Skips the named where-clause parameter for this row set.
 void sortRows(Row[] rows)
           
 void sourceChanged(EntityEvent event)
          Handles events reported to (EntityListener)s.
protected  void substituteAttribute(ViewAttributeDefImpl existingDef, ViewAttributeDefImpl replacement)
          Strictly Internal: Applications should not use this method.
 boolean throwOnListBindingMismatch()
           
protected  void unpinDetailQC(QueryCollection qc)
           
 void unselectAttributeDefs(java.lang.String[] attrNameArray)
          Does not select or unselect any attributes, but removes the attributes in attrNameArray from a private member variable of ViewObjectImpl.
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.
protected  void validateRangeSizeForRangePaging(ViewRowSetImpl vrs, int rangeSize)
          Advanced Internal method only.
 Node writeXML(int depthCount, long options)
          Renders data in a canonical XML-format.
 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, java.util.HashMap voAttrRules)
          Renders data in a canonical XML-format.
 Node writeXML(long options, java.util.HashMap voAttrMap, XSLStylesheet xslt)
           
 
Methods inherited from class oracle.jbo.server.ComponentObjectImpl
addListener, create, createRef, ensureVariableManager, findOperationDefinitions, findPersDefObject, getAllProperties, getCompListeners, getCompListenersList, getDefinitionManager, getFullNameForPersDef, getHintValue, getLabel, getLabelPlural, getMessageBundleClass, getProxyClassName, getResourceBundleDef, getRootApplicationModule, getStringFromMessageBundle, getTooltip, getVariableManager, hasVariables, isDead, isPersonalized, isRegWithPiggyMan, resolvePropertyRaw, setName, setParent
 
Methods inherited from class oracle.jbo.server.NamedObjectImpl
setParent, setPropertiesMap
 
Methods inherited from class oracle.jbo.common.NamedObjectImpl
allocatePropertyMap, getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionsMap, getPropertyMap, getResourcesFromBundle, isPropertyExpression, mergePropertyMap, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, setFullName, setPropertiesMap2, setProperty, setProperty, setPropertyExpression, setPropertyMap
 
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.VariableManagerOwnerBase
ensureVariableManager, getMessageBundleClass, getResourceBundleDef, getVariableManager, hasVariables
 
Methods inherited from interface oracle.jbo.ComponentObject
getFullName, getName
 
Methods inherited from interface oracle.jbo.GenericHints
getHintValue, getLabel, getLabelPlural, getTooltip
 
Methods inherited from interface oracle.jbo.Properties
getProperties, getProperty, getProperty, refreshProperty
 

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

PROPERTY_DEFERRED_ESTIMATED_ROWCOUNT

public static final java.lang.String PROPERTY_DEFERRED_ESTIMATED_ROWCOUNT
A custom property name that indicates if this VO should defer calling estimatedRowCount in the 'getDeferredEstimatedRowCount' method.

See Also:
Constant Field Values

INTERNAL_EXPR_VALUE_OVERRIDES

public static final java.lang.String INTERNAL_EXPR_VALUE_OVERRIDES
See Also:
Constant Field Values
For internal use only. Application developers should not use this
A custom property name to indicate expression name overide on entity refs.

mViewDef

protected ViewDefImpl mViewDef

mAssocRefs

protected java.util.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

mDefaultRowSetMap

protected volatile java.util.Map mDefaultRowSetMap

mAttrDefs

protected ViewAttributeDefImpl[] mAttrDefs

mChgAttrIndUseCount

protected int mChgAttrIndUseCount

mChangedAttrIndices

protected int[] mChangedAttrIndices

mAttrDefsTab

protected java.util.HashMap mAttrDefsTab

mKeyAttrRefs

protected ViewAttributeDefImpl[] mKeyAttrRefs

mAutoPostChanges

protected boolean mAutoPostChanges

mDynAttrOffset

protected int mDynAttrOffset

QC_TAG

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

DISC_TAG

protected static final java.lang.String DISC_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

ENT_HDL_TRACKER

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

ENT_REF_INDEX

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

DYN_ATTRS

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

DYN_ATTRS_ENTRY

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

DYN_ATTRS_NAME

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

DYN_ATTRS_TYPE

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

DYN_ATTRS_EXPR

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

EFFDT_MODE

protected static final java.lang.String EFFDT_MODE
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

getImageLoc

public java.lang.String getImageLoc(boolean bOpen)

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.

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 ComponentObject
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 ComponentObject
Specified by:
getDefFullName in interface StructureDef
Overrides:
getDefFullName in class ComponentObjectImpl
Returns:
the fully qualified view definition name.

getSubstitutedDefNames

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

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

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

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.

getDef

public DefObject getDef()
Internal: Applications should not use this method.

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

Returns:
the definition object.

initFromDef

protected void initFromDef()

applyPersonalization

public void applyPersonalization()
Overrides:
applyPersonalization in class ComponentObjectImpl

resetSelectedAttributeDefs

public void resetSelectedAttributeDefs(boolean forceSelectAllAttributes)
Does not select or unselect any attributes, but clears the private member variable of ViewObjectImpl that holds the attributes that should be selected. To execute a view object in SI mode, the user should typically call resetSelectedAttributeDefs(), followed by selectAttributeDefs and unselectAttributeDefs any number of times, followed by executeQuery() or similar function such as first(). If resetSelectedAttributeDefs is not called, selectAttributeDefs and unselectAttributeDefs may have no effect or may throw a NullPointerException. If none of these functions are called prior to executeQuery, then all attributes will be selected.

Parameters:
forceSelectAllAttributes - false means select only the force active attributes (ie. those that have Selected In Query = true, such as the primary key), and true means select all attributes

See Also:
selectAttributeDefs(String[])

resetSelectedAttributeDefs

public void resetSelectedAttributeDefs()
Calls resetSelectedAttributeDefs(false).

See Also:
resetSelectedAttributeDefs(boolean)

selectAttributeDefs

public void selectAttributeDefs(java.lang.String[] attrNameArray)
Does not select or unselect any attributes, but adds the attributes in attrNameArray to a private member variable of ViewObjectImpl. A call to isExecuted or execute will actually select the attributes. At that time, ADF will automatically select dependent attributes. Note that if in the first execution of this view object only A and B were active, and if prior to the second execution the user called resetSelectedAttributeDefs followed by selectAttributeDefs to activate C, then in the second execution only C will be active.

Parameters:
attrNameArray - The attributes to activate in the next call to buildQuery or isExecuted

See Also:
resetSelectedAttributeDefs(), unselectAttributeDefs(String[])

unselectAttributeDefs

public void unselectAttributeDefs(java.lang.String[] attrNameArray)
Does not select or unselect any attributes, but removes the attributes in attrNameArray from a private member variable of ViewObjectImpl. Note that force active attributes (ie. those that have Selected In Query = true, such as the primary key), will never be unselected.

Parameters:
attrNameArray - The attributes to activate in the next call to buildQuery or isExecuted

See Also:
resetSelectedAttributeDefs(), selectAttributeDefs(String[])

processNewSelectSet

protected void processNewSelectSet()

Activate the attributes selected in calls to selectAttributeDefs, unselectAttributeDefs. In other words, activate the attributes in the private member variable of ViewObjectImpl that holds the fields that should be selected.

Derived classes may override this method to select additional attributes. But remember to call the superclass function.

this function also handles the case when no new attributes have been selected, but the view criteria or order by have changed.

See Also:
resetSelectedAttributeDefs(), selectAttributeDefs(String[]), unselectAttributeDefs(String[]), processNewSelectSetSimple()

isEntityReferenceSelected

protected boolean isEntityReferenceSelected(EntityReference eRef)
Tell whether the given entity reference has been selected (ie. if any attributes from the entity usage have been selected). If we're not in runtime SQL generation mode (ie. SI mode or declarative SQL mode), or if eRef is null, this function returns true.

Parameters:
eRef - Has this entity reference been selected for the current query
Returns:
true if the entity reference has been selected

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.

setThrowOnListBindingMismatch

public void setThrowOnListBindingMismatch(boolean b)
Internal: Applications should not use this method.

For use only in service case where listbindings on the rows of this ViewObject should throw an exception on mismatch.


throwOnListBindingMismatch

public boolean throwOnListBindingMismatch()

marshalListBindingDefs

public java.lang.Object marshalListBindingDefs(java.lang.String subTypeName)
Internal: Applications should not use this method.


lookupListBindingDef

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

Specified by:
lookupListBindingDef in interface ViewObject

findListBindingDef

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

Specified by:
findListBindingDef in interface ViewObject
Parameters:
lbName - listbinding name
Returns:
listbinding definition

getApplicationModuleForLocalViewObject

protected ApplicationModule getApplicationModuleForLocalViewObject()

findOrCreateLocalViewObject

protected ViewObject findOrCreateLocalViewObject(java.lang.String usageName)
Find or create the local view instance from the local view usage name.

Parameters:
usageName - The local view usage name.
Returns:
The local view object.

findOrCreateLocalViewObject

protected ViewObject findOrCreateLocalViewObject(java.lang.String usageName,
                                                 java.lang.String voName)
Find or create the local view instance from the local view usage name.

Parameters:
usageName - The local view usage name.
voName - Full name the VO to find or create
Returns:
The local view object.

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.

getDefaultRowSetInternal

protected ViewRowSetImpl getDefaultRowSetInternal()

getQueryTimeOut

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

Specified by:
getQueryTimeOut in interface ViewObject
Returns:
the current query time out value.

setQueryTimeOut

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

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

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

cancelQuery

public boolean cancelQuery()
Description copied from interface: RowSet
Cancels a running query.

Specified by:
cancelQuery in interface RowSet
Returns:
a flag indicating whether the request to cancel was honored or not. It will return false if the JDBC statement is not executing a query.

getSelectClauseFlags

public int getSelectClauseFlags()

setSelectClauseFlags

public void setSelectClauseFlags(int flags)

getFromClauseFlags

public int getFromClauseFlags()

setFromClauseFlags

public void setFromClauseFlags(int flags)

getWhereClauseFlags

public int getWhereClauseFlags()

setWhereClauseFlags

public void setWhereClauseFlags(int flags)

getSelectClause

public java.lang.String getSelectClause()

setSelectClause

public void setSelectClause(java.lang.String selClause)

getFromClause

public java.lang.String getFromClause()

setFromClause

public void setFromClause(java.lang.String fromClause)

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()
Deprecated. since 10.0.1.3 use getRowMatch().

Gets the in-memory filter for the view object. This method is now deprecated. One should use getRowMatch() instead.


setRowQualifier

public void setRowQualifier(RowQualifier rowQualifier)
Deprecated. since 10.0.1.3 use setRowMatch(oracle.jbo.RowMatch).

Sets an in-memory filter for the view object. This method is now deprecated. One should use setRowMatch(oracle.jbo.RowMatch) instead.


getRowMatch

public RowMatch getRowMatch()
Gets the in-memory filter (RowMatch) for the view object. While the where-clause is used when a database query is issued, the row match is used for qualifying rows in memory.

Specified by:
getRowMatch in interface ViewObject
Returns:
the current row match.

setRowMatch

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

Specified by:
setRowMatch in interface ViewObject
Parameters:
rowMatch - the new row match.

getRowMatchFromViewCriteria

public RowMatch getRowMatchFromViewCriteria()

setRowMatchFromViewCriteria

protected void setRowMatchFromViewCriteria(RowMatch rowMatch)

qualifiesRowFilter

protected boolean qualifiesRowFilter(QueryCollection qc,
                                     java.lang.Object[] values,
                                     int filterOffset)

rowQualifies

protected boolean rowQualifies(ViewRowImpl vr)
Evaluates whether the view row qualifies the view object's row match and in-memory filter view criteria.

This method is invoked on new view rows as well as view rows coming from query to see if the view row should be added to the query collection.

Parameters:
vr - the view row to examine.
Returns:
a boolean value indicating whether the row qualifies or not.

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.

getSortBy

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

setSortBy

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

Specified by:
setSortBy in interface ViewObject
Parameters:
sortBy - in-memory sort clause

processSortCriteria

protected void processSortCriteria()

getSortCriteria

public SortCriteria[] getSortCriteria()

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.

setReqdVC

public void setReqdVC(ViewCriteria vc)
Deprecated. use setRequiredViewCriteria()

This method is now deprecated. One should use setRequiredViewCriteria() instead.


setRequiredViewCriteria

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

Specified by:
setRequiredViewCriteria in interface ViewObject
Parameters:
vc - Set the criteria as required view criteria for this view object instance.

getReqdVC

public ViewCriteria getReqdVC()
Deprecated. use getRequiredViewCriteria()

This method is now deprecated. One should use getRequiredViewCriteria() instead.


getRequiredViewCriteria

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

Specified by:
getRequiredViewCriteria in interface ViewObject

refreshWhereClauseParams

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

defineNamedWhereClauseParam

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

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

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

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

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

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

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

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

removeNamedWhereClauseParam

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

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

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

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

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

getNamedWhereClauseParam

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

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

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

setNamedWhereClauseParam

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

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

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

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

skipNamedWhereClauseParam

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

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

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

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.

setNamedWhereClauseParams

public void setNamedWhereClauseParams(AttributeList attrlist)
Sets a specified bind name, value pair. 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, setNamedWhereClauseParams uses the return value from getNamedWhereClauseParams as its parameters for the the WHERE clause,

  ViewObject xVO = am.findViewObject("DeptView");
       String whereClause = "Dept.DEPTNO = :deptBind";
       System.out.println("setWhereClause("+whereClause+") with
 setWhereClauseParam() after");
       xVO.setWhereClause(whereClause);
       xVO.defineNamedWhereClauseParam("deptBind", null, null);
       xVO.setNamedWhereClauseParam("deptBind",new Number(10));
       AttributeList myattr = xVO.getNamedWhereClauseParams();
       xVO.setNamedWhereClauseParams(myattr);
       xVO.executeQuery();
       printVO(xVO);
 
This method should not be overridden.

Specified by:
setNamedWhereClauseParams in interface RowSet
Parameters:
attrlist - the array of name, value pairs of bind variables.

getNamedWhereClauseParams

public AttributeList getNamedWhereClauseParams()
Gets the bind name, value pair of all Named bind variables. This method delegates its call to the default RowSet.

In the following exmple, getNamedWhereClauseParams returns the name, value pair and also getting used as input to setNamedWhereClauseParams,

  ViewObject xVO = am.findViewObject("DeptView");
       String whereClause = "Dept.DEPTNO = :deptBind";
       System.out.println("setWhereClause("+whereClause+") with
 setWhereClauseParam() after");
       xVO.setWhereClause(whereClause);
       xVO.defineNamedWhereClauseParam("deptBind", null, null);
       xVO.setNamedWhereClauseParam("deptBind",new Number(10));
       AttributeList myattr = xVO.getNamedWhereClauseParams();
       xVO.setNamedWhereClauseParams(myattr);
       xVO.executeQuery();
       printVO(xVO);
 

Specified by:
getNamedWhereClauseParams in interface RowSet
Returns:
the AttributeList of Name, value pair of all named bind variables. This method should not be overridden.

getDBTransaction

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

This method should not be overridden.

Returns:
the database transaction.

shouldPutJoinConstraintInWhereClause

public boolean shouldPutJoinConstraintInWhereClause()
Specified by:
shouldPutJoinConstraintInWhereClause in interface ViewCriteriaManagerOwner

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.

getQueryHint

public java.lang.String getQueryHint()

setQueryHint

public void setQueryHint(java.lang.String queryHint)

buildSubquery

public java.lang.String buildSubquery(AttributeDef[] attrsToSelect,
                                      java.lang.String whereClause,
                                      AttributeDef accessor,
                                      ViewCriteria nestedVC)
Specified by:
buildSubquery in interface ViewCriteriaClauseBuilder

buildQuery

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

buildQuery

protected java.lang.String buildQuery(int noUserParams,
                                      boolean forRowCount,
                                      java.lang.String selClause,
                                      java.lang.String fromClause,
                                      java.lang.String whereClause,
                                      int subQueryLevel)

prepareRowSetForQuery

public void prepareRowSetForQuery(ViewRowSetImpl vrs,
                                  Row[] masterRows)
This method is invoked when ViewRowSetImpl::execute() is called. It can be overridden to change query statement or add bind parameter for the rowset.

Parameters:
vrs - the rowset that will contain the rows when queried.
masterRows - the master rows

prepareRowSetForQuery

public void prepareRowSetForQuery(ViewRowSetImpl vrs)

prepareVOForQuery

public void prepareVOForQuery()
Prepare view object for build query. In non SI mode, do nothing. In SI mode,
  • activate the attributes in mNewSelectAttrNameset
  • activate the attributes that are the source field of links to child view objects
  • activate entity objects that are used in the WHERE or ORDER BY or GROUP BY but not the select
  • activate join constraint view criteria if necessary


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 nextParamIndex,
                                     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)

getCappedQueryHitCount

public long getCappedQueryHitCount(ViewRowSetImpl viewRowSet,
                                   Row[] masterRows,
                                   long oldCap,
                                   long cap)
This method executes a count query and returns the number of rows that could end up in the rowset. The count query could be very expensive in some scenarios if we were to execute without an upper limit. The method provides a cap argument so that we can execute a query that aborts the count as soon as the cap is met.

Parameters:
viewRowSet - the rowset that will contain the rows when fetched.
masterRows - the master rows are needed to get the parameters in a master detail scenario to bind to the row count query.
oldCap - current not used.
cap - the limit on the count expected
Returns:
+ve number if the row count is less than the limit or limit itself.

buildSelectClause

protected java.lang.String buildSelectClause()

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:

  • WHERE clause expression from View Links. The View Links obtain the WHERE clauses from the detail View Objects.
  • WHERE clause expression from the view definition. The view definition has the base WHERE clause that was defined at Design Time.
  • WHERE clause expression on the View Object instance. The View Object has its own WHERE clause.

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:

  • Order-by-clause from the view definition. The view definition has the base ORDER BY clause that was defined at Design Time.
  • Order-by-clause on the View Object instance. The View Object has its own ORDER BY clause.

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:

  • Bind values supplied by the user through setWhereClauseParam().
  • Bind values supplied by the master row, to be used in WHERE clause expressions derived from View Links.

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

findViewDefFromDiscrVals

public ViewDefImpl findViewDefFromDiscrVals(java.sql.ResultSet resultSet,
                                            AttributeList initValues)

findViewDefFromDiscrVals

public ViewDefImpl findViewDefFromDiscrVals(java.sql.ResultSet resultSet,
                                            AttributeList initValues,
                                            EntityImpl[] entities)

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()

createInstanceWithEntities

protected ViewRowImpl createInstanceWithEntities(int[] eoIndices,
                                                 EntityImpl[] entities,
                                                 ViewRowSetImpl viewRowSet,
                                                 AttributeList attrValList)

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)

createAndInitRowForCollection

protected ViewRowImpl createAndInitRowForCollection(java.lang.Object qc,
                                                    AttributeList initVals)

populateAttributeForRow

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

getDiscrColLoadIndices

protected int[] getDiscrColLoadIndices()

createRowFromResultSet

protected ViewRowImpl createRowFromResultSet(java.lang.Object iqc,
                                             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.

Parameters:
index - entity base 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.

lookupViewAccessorDef

public ViewAccessorDef lookupViewAccessorDef(java.lang.String vaName)

findViewAccessorDef

public ViewAccessorDef findViewAccessorDef(java.lang.String name)

getViewAccessorDefsInternal

public java.util.ArrayList getViewAccessorDefsInternal()
Deprecated. Use lookupViewAccessorDef instead.

For internal use only.

Returns:
a consolidated list of view accessor defs coming from programmatic creation of view accessor defs, applying a personalization or from the base view definition

getOperationDefinitions

public OperationDefinitionsImpl getOperationDefinitions()
Deprecated. 

For internal framework use only.


getRowOperationDefinitions

public OperationDefinitionsImpl getRowOperationDefinitions()
Deprecated. 

For internal framework use only.


hideAttributeDef

public void hideAttributeDef(java.lang.String attrName)

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.

isAttributeKey

public boolean isAttributeKey(AttributeDef attrDef)

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. If runtime SQL generation is enabled return the active attributes.

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

lookupAltKeyDef

public KeyDef lookupAltKeyDef(java.lang.String keyName)

findAltKeyDef

public KeyDef findAltKeyDef(java.lang.String keyName)

getAltKeyAttrDefs

public AttributeDef[] getAltKeyAttrDefs(java.lang.String keyName)

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()
This method is equivalent to getKeyAttributeDefs().

Returns:
the array of key 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

forceExecuteQueryOfSharedVO

public void forceExecuteQueryOfSharedVO()

executeEmptyRowSet

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

executeDetailQuery

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

getRowComparator

public java.util.Comparator getRowComparator()

sortRows

public void sortRows(Row[] rows)

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)

getRangePageStartForCollection

protected final int getRangePageStartForCollection(java.lang.Object qc)

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

getColumnNameForQuery

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

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.

addDynamicAttributeWithType

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

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.

getBackwardDependencyAttributes

public java.util.List getBackwardDependencyAttributes(java.lang.String attrName)
Specified by:
getBackwardDependencyAttributes in interface AttributeDependencyManager

getForwardDependencyAttributes

public java.util.List getForwardDependencyAttributes(java.lang.String attrName)
Specified by:
getForwardDependencyAttributes in interface AttributeDependencyManager
Specified by:
getForwardDependencyAttributes in interface ViewObject

getBackwardDependencies

public java.util.HashSet<java.lang.String> getBackwardDependencies(java.lang.String attrName)
Specified by:
getBackwardDependencies in interface AttributeDependencyManager

getForwardDependencies

public java.util.HashSet<java.lang.String> getForwardDependencies(java.lang.String attrName)
Specified by:
getForwardDependencies in interface AttributeDependencyManager

addForwardDependency

public void addForwardDependency(java.lang.String attrName,
                                 java.lang.String depName)
Specified by:
addForwardDependency in interface AttributeDependencyManager

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.

getCachedQueryCollection

protected QueryCollection getCachedQueryCollection(RowFilter rowFilter)
Internal: Applications should not use this method.

Returns the QueryCollection associated with the key

Parameters:
rowFilter - the row filter for the query collection.
Returns:
the query collection if one is found. null otherwise.

getAllCachedQueryCollections

protected java.util.Enumeration getAllCachedQueryCollections()

unpinDetailQC

protected void unpinDetailQC(QueryCollection qc)
For internal use only. Application developers should not use this
for framework use only

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)

markQueryCollectionDirty

protected void markQueryCollectionDirty(QueryCollection qc,
                                        boolean isDirty)
Given a query collection qc and a flag isDirty, explicitly sets the query collection's dirty status.

This method may be used to set or unset the dirty status of a query collection. Its recommended use is during activation, in conjunction with custom passivation of the QC dirty flag.

The method setDirty should not be used, as it updates only a subset of the necessary internal data structures.

Parameters:
qc - the query collection in question. If qc is null, the method does nothing.
isDirty - if true, the QC is marked dirty. If false, the QC is marked clean.
See Also:
QueryCollection.setDirty(boolean)

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:

  • BINDING_STYLE_ORACLE
  • BINDING_STYLE_JDBC
  • BINDING_STYLE_UNKNOWN

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:

  • BINDING_STYLE_ORACLE
  • BINDING_STYLE_JDBC
  • BINDING_STYLE_UNKNOWN

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

getViewLinkAccessorInfo

protected ViewLinkAccessorInfo getViewLinkAccessorInfo()

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
Parameters:
size - the maximum number of rows to fetch. The default, -1, retrieves an unlimited number of rows. 0 causes the query not to be executed, and row set is empty.

getQueryMode

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

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

The default query mode is QUERY_MODE_SCAN_DATABASE_TABLES.

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

setQueryMode

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

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

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

The default query mode is QUERY_MODE_SCAN_DATABASE_TABLES.

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

addQueryMode

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

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

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

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

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()

getViewCriteriaManager

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

getViewCriteriaManagerInternal

public ViewCriteriaManager getViewCriteriaManagerInternal()

appendViewCriteria

public final void appendViewCriteria(ViewCriteria criteria)
Appends this viewcriteria to the existing list of criterias.


applyViewCriteria

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

Specified by:
applyViewCriteria in interface ViewCriteriaManager
Specified by:
applyViewCriteria in interface ViewObject
Parameters:
criteria - view criteria to be applied

applyViewCriteria

public void applyViewCriteria(ViewCriteria criteria,
                              boolean bAppend)
Description copied from interface: ViewObject
Applied the view criteria to this view object. If bAppend is true view criteria is appended to the list of already applied view criteria. If bAppend is false the applied view criteria list is cleared prior to applying the passed view criteria.

Specified by:
applyViewCriteria in interface ViewCriteriaManager
Specified by:
applyViewCriteria in interface ViewObject
Parameters:
criteria - view criteria to be applied
bAppend - flag to indicate if the applied view criteria list needs to be cleared before applying the view criteria.

clearViewCriterias

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

Specified by:
clearViewCriterias in interface ViewCriteriaManager

getViewCriteria

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

This method should not be overridden.

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

getViewCriteria

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

Specified by:
getViewCriteria in interface ViewCriteriaManager
Parameters:
name - view criteria name
Returns:
a view criteria reference or null

putViewCriteria

public void putViewCriteria(java.lang.String name,
                            ViewCriteria vc)
Description copied from interface: ViewCriteriaManager
Add a view criteria to be managed by this object

Specified by:
putViewCriteria in interface ViewCriteriaManager
Parameters:
name - Name of the view criteria
vc - view criteria reference

removeViewCriteria

public ViewCriteria removeViewCriteria(java.lang.String name)
Description copied from interface: ViewCriteriaManager
Removes the view criteria from this manager. If it is applied it is first unapplied and then removed. If the intent is to simply unapply use removeApplyViewCriteriaName API.

Specified by:
removeViewCriteria in interface ViewCriteriaManager
Parameters:
name - The view criteria name that needs to be removed
Returns:
reference to the removed view criteria if found.

getApplyViewCriteriaNames

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

setApplyViewCriteriaNames

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

Specified by:
setApplyViewCriteriaNames in interface ViewCriteriaManager
Parameters:
names - the criterias to be applied.

setApplyViewCriteriaName

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

Specified by:
setApplyViewCriteriaName in interface ViewCriteriaManager
Parameters:
name - the criteria to be applied.

setApplyViewCriteriaName

public void setApplyViewCriteriaName(java.lang.String name,
                                     boolean bAppend)
Description copied from interface: ViewCriteriaManager
Apply the view crtieria name passed as the argument. If bAppend is true the passed view criteria will be applied in addition to the existing ones. If bAppend is false this method is identical to ViewCriteriaManager.setApplyViewCriteriaName(String)

Specified by:
setApplyViewCriteriaName in interface ViewCriteriaManager
Parameters:
name - the criteria to be applied
bAppend - pass true if the view criteria needs to be appended to the applied list otherwise the list is cleared out.

getApplyJoinedViewCriteriaNames

public java.lang.String[] getApplyJoinedViewCriteriaNames()

setApplyJoinedViewCriteriaNames

public void setApplyJoinedViewCriteriaNames(java.lang.String[] names)

removeApplyViewCriteriaName

public boolean removeApplyViewCriteriaName(java.lang.String name)
Description copied from interface: ViewCriteriaManager
Unapplied the view criteria if it is applied. The view criteria will continue to be managed by this manager.

Specified by:
removeApplyViewCriteriaName in interface ViewCriteriaManager
Parameters:
name - The view criteria name that need to be unapplied.
Returns:
true if the view criteria was found to be applied, false otherwise.

getApplyAllViewCriterias

public ViewCriteria[] getApplyAllViewCriterias(int criteriaMode,
                                               boolean getAllReqdVC)

getApplyViewCriterias

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

Specified by:
getApplyViewCriterias in interface ViewCriteriaManager
Parameters:
criteriaMode - the mode to match the criteria.
Returns:
An array of matching applied view criterias.

setCurrentUnionViewCriteriaName

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

getAllViewCriteriaNames

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

Specified by:
getAllViewCriteriaNames in interface ViewCriteriaManager
Returns:
an array of view criteria names

getAvailableViewCriteriaNames

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

Specified by:
getAvailableViewCriteriaNames in interface ViewCriteriaManager
Returns:
the names of the criteria that can still be applied

getAllViewCriterias

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

Specified by:
getAllViewCriterias in interface ViewCriteriaManager
Returns:
an array of view criteria

setViewCriteriaAdapter

public void setViewCriteriaAdapter(ViewCriteriaAdapter adapter)

buildViewCriteriaClauses

public CriteriaClauses buildViewCriteriaClauses(ViewCriteria vc)
Description copied from interface: ViewCriteriaManager
This method is used by the framework to generate a query clause for a particular view criteria. Used by ViewCriteriaManager.getViewCriteriaClause(boolean)

Specified by:
buildViewCriteriaClauses in interface ViewCriteriaClauseBuilder
Specified by:
buildViewCriteriaClauses in interface ViewCriteriaManager
Parameters:
vc - the view criteria whose criteria needs to be generated
Returns:
a reference to an object that store clauses for both database and in-memory filtering

getViewCriteriaClause

public java.lang.String getViewCriteriaClause()
Deprecated. since 10.0.3. use getViewCriteriaClause(boolean) instead.

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.

getViewCriteriaClause

public java.lang.String getViewCriteriaClause(boolean forQuery)
Generates the WHERE clause expression from the applied view criterias. This method is responsible for converting the applied view criterias into a WHERE clause expression.

Specified by:
getViewCriteriaClause in interface ViewCriteriaManager
Parameters:
forQuery - indicates whether the WHERE clause returned will be used in a database query or in-memory filtering. If true, the clause is for database query.
Returns:
the WHERE clause to be used for either database query or in-memory filtering.

getCriteriaAdapter

public CriteriaAdapter getCriteriaAdapter()
Return a custom CriteriaAdapter implementation to generate where clause for ViewCriteria. The default implementation here returns null, and leave it to the ViewCriteriaManager implementation class to determine which CriteriaAdapter class to use. Subclasses can override this method to provide a custom CriteriaAdapter implementation.

Returns:
Custom CriteriaAdapter implementation if desired, or null.

getCriteriaItemClause

public java.lang.String getCriteriaItemClause(ViewCriteriaItem vci)
Interpret the given ViewCriteriaItem and generate a where clause fragment for the ViewCriteriaItem. The default implementation returns null to allow the CriteriaAdapter class to generate the where clause for all ViewCriteriaItems. Subclasses can optionally override this method to generate where clause for each individual ViewCriteriaItem.

Parameters:
vci - The ViewCriteriaItem from which a where clause fragment should be generated for.
Returns:
The where clause fragment for the ViewCriteriaItem, or null if the work is to be delegated to the CriteriaAdapter.

getCriteriaItemAttributeHints

public AttributeHints getCriteriaItemAttributeHints(ViewCriteriaItem vci)
By default return null. Subclasses may override to return custom AttributeHints implementation for the given criteria item.

Specified by:
getCriteriaItemAttributeHints in interface ViewObject
Returns:
Custom AttributeHints implementation if any for this criteria item.

applyBindVariableForCriteria

protected boolean applyBindVariableForCriteria(ViewCriteria criteria,
                                               Variable variable,
                                               java.lang.Object variableValue)
Subclasses may override to return false when a bind variable defined for this criteria or one of it's contained items should not be applied to the statement object during query because some custom code disabled the criteria fragment that would have used this given bind variable. This check is only called for criterias that are being applied to this ViewObject's jdbc statement. The base implementation returns true for all variables.

Parameters:
criteria - for which framework is seeking to apply bind variables on the jdbc statement.

criteriaChanged

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

Specified by:
criteriaChanged in interface ViewCriteriaManagerOwner
Specified by:
criteriaChanged in interface ViewCriteriaManager
Parameters:
vc - the view criteria that has changed

criteriaSelReqBindVarsChanged

public void criteriaSelReqBindVarsChanged(ViewCriteria vc)

resetCriteria

public void resetCriteria(ViewCriteria vc)
Description copied from interface: ViewCriteriaManager
Resets a view criteria to the state as defined in the View Definition.

Specified by:
resetCriteria in interface ViewCriteriaManager
Parameters:
vc - View Criteria to be reset

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(int[])). 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()

adjustERCWithChangedRows

public boolean adjustERCWithChangedRows()

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()

getDeferredEstimatedRowCount

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

Specified by:
getDeferredEstimatedRowCount in interface RowSet
Returns:
-1 until either EstimatedRowCount or real RowCount is known.

getDetailEstimatedRowCount

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

getCappedRowCount

public long getCappedRowCount(long cap)
This method executes a count query and returns the number of rows that could end up in the rowset. The count query could be very expensive in some scenarios if we were to execute without an upper limit. The method provides a cap argument so that we can execute a query that aborts the count as soon as the cap is met.

Specified by:
getCappedRowCount in interface RowSet
Parameters:
cap - the limit on the count expected
Returns:
+ve number if the row count is less than the limit, a -cap number if the row count is possibly greater than the cap.

getDeferEstimatedRowCountProperty

protected java.lang.Boolean getDeferEstimatedRowCountProperty()

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

getDefaultRangeSize

public int getDefaultRangeSize()

setDefaultRangeSize

public void setDefaultRangeSize(int i)

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:

  • getRow returns one row only, findByKey() returns multiple rows.
  • getRow populates the collection until it finds a match, but findByKey retrieves rows first from the cache and then from the database, and does not populate the collection.
  • findByKey may be much faster than getRow.
  • getRow returns the first matching row, findByKey may retrieve rows in the order not specified by the query.
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:

  • SLOT_VALID if the iterator is on a valid row.
  • SLOT_DELETED if the current row of the iterator was just removed.
  • SLOT_BEFORE_FIRST if the iterator is on the slot before the first row.
  • SLOT_BEYOND_LAST if the iterator is on the slot after the last row.

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 RowIterator.removeCurrentRowAndRetain(), change currency to the desired location, and then call RowIterator.insertRow(oracle.jbo.Row) with that row.

Specified by:
removeCurrentRowFromCollection in interface RowIterator

removeCurrentRowAndRetain

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

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

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

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

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

getRangeIndexOf

public int getRangeIndexOf(Row row)
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 ScrollEvent to be sent to RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the RowSetListener interface. Further, this listener must be registered through a call to NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

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

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

getPreviousRangeSet

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

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

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

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

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

getViewObject

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

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

    RowSet detailRS = (RowSet) masterViewRow.getMyDetail();
    ViewObject detailVO = detailRS.getViewObject();
 

Specified by:
getViewObject in interface RowSet
Returns:
the parent view object.

isDefaultRowSet

public boolean isDefaultRowSet()
Internal: Applications should not use this method.

Specified by:
isDefaultRowSet in interface RowSet
Returns:
true always.

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.

buildKey

public Key buildKey(java.lang.Object[] values)

findInCacheByKey

public Row[] findInCacheByKey(Key key,
                              int maxNumOfRows)

findInCacheByAltKey

public RowIterator findInCacheByAltKey(java.lang.String keyName,
                                       Key key,
                                       int maxNumOfRows)

findByKey

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

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

findAndSetCurrentRowByKey

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

needsRefresh

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

findByKey

public Row[] findByKey(Key key,
                       int maxNumOfRows,
                       boolean skipWhere)
If skipWhere is true, then do not use the where-clause fragments associated with this ViewObject if a query is used to retreieve the matching row during this findByKey operation on this ViewObject. skipwhere=true does not work for expertmode ViewObjects.


findByAltKey

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

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

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

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

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.

findRowsMatchingCriteria

public final RowIterator findRowsMatchingCriteria(ViewCriteria criteria,
                                                  int maxNumOfRows)
Performs findByViewCriteria(criteria, maxNumOfRows, QUERY_MODE_SCAN_DATABASE_TABLES & QUERY_MODE_SCAN_VIEW_ROWS);


findByViewCriteria

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

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

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

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

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

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

Specified by:
findByViewCriteria in interface RowIterator
Parameters:
criteria - the View Criteria to be used to qualify View rows.
maxNumOfRows - the maximum size of the array to return, or -1 to return all rows. If a value other than -1 is specified and if the specified number of rows is reached, the method returns without performing any further operation.
queryMode - the mode in which qualify View rows are scanned. See above for further info.
Returns:
a RowSet (parented by the same View Object as this RowIterator) that contains qualifying rows. For convenience, this RowSet's range size is initialized to -1 (all rows).

findByViewCriteriaWithBindVars

public RowIterator findByViewCriteriaWithBindVars(ViewCriteria criteria,
                                                  int maxNumOfRows,
                                                  int queryMode,
                                                  Variable[] vars,
                                                  java.lang.Object[] values)

findByViewCriteriaWithBindVars

public RowIterator findByViewCriteriaWithBindVars(ViewCriteria[] criterias,
                                                  int maxNumOfRows,
                                                  int queryMode,
                                                  Variable[] vars,
                                                  java.lang.Object[] values)

findByViewCriteriaForViewRowSet

protected RowIterator findByViewCriteriaForViewRowSet(ViewRowSetImpl vrs,
                                                      ViewCriteria criteria,
                                                      int maxNumOfRows,
                                                      int queryMode,
                                                      Variable[] vars,
                                                      java.lang.Object[] values)

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.
rowIndex - Index in the RowSet where the new row is 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.
rowIndex - Index in the RowSet where the row is deleted.

notifyRowUpdated

protected void notifyRowUpdated(QueryCollection qc,
                                Row row,
                                int[] attrIndices,
                                boolean markQCDirty)

notifyRowUpdated

protected void notifyRowUpdated(QueryCollection qc,
                                Row row,
                                int[] attrIndices,
                                UpdateEvent rowUpdateEvent)

notifyRowUpdated

protected void notifyRowUpdated(ViewRowSetImpl vrs,
                                Row[] viewRows,
                                int[] attrIndices,
                                UpdateEvent updateEvent)
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.
entityEVent - that is causing this view object level event.

notifyRowUpdated

protected void notifyRowUpdated(ViewRowSetImpl vrs,
                                Row[] viewRows,
                                int[] attrIndices)

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.

getRowSetsInternal

public java.util.List<ViewRowSetImpl> getRowSetsInternal()

getRowSetForSqlGen

public ViewRowSetImpl getRowSetForSqlGen()

getBindValsForSqlGen

public java.util.HashMap getBindValsForSqlGen()

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)

createViewRowSet

protected ViewRowSetImpl createViewRowSet(java.lang.String rsName,
                                          boolean isDefaultRS,
                                          boolean isAccessorRS,
                                          boolean passivateRS)

addRowSet

protected void addRowSet(ViewRowSetImpl rs)

removeRowSet

protected void removeRowSet(ViewRowSetImpl rs)

getViewLinkDestinationAttributes

protected java.util.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

getDefaultAccessMode

public byte getDefaultAccessMode()

setDefaultAccessMode

public void setDefaultAccessMode(byte b)

getAccessMode

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

setAccessMode

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

getDefaultRangePagingCacheFactor

public int getDefaultRangePagingCacheFactor()

setDefaultRangePagingCacheFactor

public void setDefaultRangePagingCacheFactor(int i)

getRangePagingCacheFactor

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

setRangePagingCacheFactor

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

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.

setDefaultAssocConsistent

protected void setDefaultAssocConsistent(boolean isEquiJoin)

isDefaultAssocConsistent

protected boolean isDefaultAssocConsistent()

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)

getFullLoggingName

public java.lang.String getFullLoggingName()
This method will return [view def name]view full name"

Returns:

getPreparedStatement

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

getCallableStatement

protected java.sql.CallableStatement getCallableStatement()
generate CallableStatement for PLSQL view object.

Returns:
the CallableStatement

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.

Parameters:
srow - entity that was removed.

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.

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.

findAssociatedEntity

protected EntityImpl findAssociatedEntity(QueryCollection qc,
                                          ViewRowImpl viewRow,
                                          EntityImpl[] entities,
                                          int srcEntityIndex,
                                          AssociationReference assocRef,
                                          java.lang.Object[] values)
When a query collection of a join VO needs to find a detail entity row related to the master entity row, related through an association, this method is invoked. This happens in two different situations. First (the update case), the client may have updated the foreign key attribute value(s) for a reference entity, necessitating a different entity row to be found. Second (the execute case), the query collection is processing executeQuery and found a new entity row in the entity cache. The query collection needs to instantiate a new unposted view row from this entity row. In the process, it needs to find the related row. The second case occurs only when the query collection has association consistency = true.

This method may be overridden by a view object developer to provide custom logic for finding related entity row.

Parameters:
qc - the query collection, which either owns the view row being updated or is being executeQuery'ed.
viewRow - the view row being updated. Is null if this method is invoked for the execute operation.
entities - array of entity rows for the view row. In the update case, it is the actual entity row array of the viewRow. In the execute case, this array will eventually be used to instantiate the unposted view row for the query collection. entities[srcEntityIndex] has the entity row of the source (master) side of the association. In the EmpDeptView example (a view object that joins Emp to Dept), this method will be called with entities[srcEntityIndex] pointing at the updated Emp entity row. The return value from the method will be the associated Dept entity row. This method does not assign the detail row into entities. It just returns the row and ADFbc will later assign it in the appropriate entity row slot.
assocRef - the association reference that describes the relationship between the master entity usage and the detail entity usage. Assoc ref is essentially a one-off over the association definition. Whereas the assoc def describes the relationship between entity defs, assoc ref describes the corresponding relationship between entity usages.
values - an object array that contains foreign key values for the detail entity row. In the above EmpDeptView example, values will be an Object[1] that contains the Deptno of the Emp entity row.
Returns:
the related (detail) entity row. If no related row is found, it returns null. In the EmpDeptView example, the return value will be the related Dept entity row.

getForeignKeyValues

public java.lang.Object[] getForeignKeyValues(EntityImpl entity,
                                              oracle.jbo.server.EntityAssociationReference assocRef)

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)

validateRangeSizeForRangePaging

protected void validateRangeSizeForRangePaging(ViewRowSetImpl vrs,
                                               int rangeSize)
Advanced Internal method only. For programmatic VOs to allow any rangeSize if they can handle it. By default, this method throws an InvalidOperException if rangeSize < 1


createViewLinkAccessorRS

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

createVariableValueManager

protected final VariableValueManager createVariableValueManager(VariableManagerOwnerBase owner,
                                                                VariableManager[] varMgrParents)
Internal: Applications should not use this method. override and call the RowSet version of the creator.

Overrides:
createVariableValueManager in class ComponentObjectImpl

createVariableValueManagerForRS

protected VariableValueManager createVariableValueManagerForRS(RowSet owner,
                                                               VariableManager[] varMgrParents)
Internal: Applications should not use this method. Framework Subclasses may use this to creaet custom subclasses of VariableValueManagerImpl


createViewAccessorRS

protected ViewRowSetImpl createViewAccessorRS(ViewAccessorDef accessorDef,
                                              Row masterRow,
                                              java.lang.Object[] values,
                                              boolean addRSToMasterRow)

createViewLinkScanBaseRS

protected ViewRowSetImpl createViewLinkScanBaseRS(AssociationDefImpl assocDef,
                                                  ViewObjectImpl accessorVO,
                                                  Row masterRow)

getMasterKeyValues

protected java.util.ArrayList getMasterKeyValues(AssociationDefImpl assocDef)
Gets a list of distinct key values from the rows in this master VO, by enumerating through its query collections.

Parameters:
assocDef - the association definition between this master VO and the scan (detail) VO
Returns:
a list of master row keys.

isMasterKeyValues

protected boolean isMasterKeyValues(java.lang.Object[] paramValues,
                                    int bindingStyle)

rangeRefreshed

public void rangeRefreshed(RangeRefreshEvent event)
Description copied from interface: RowSetListener
Invoked when the range changes.

Specified by:
rangeRefreshed in interface RowSetListener
Parameters:
event - a description of the new ranges.

rangeScrolled

public void rangeScrolled(ScrollEvent event)
Description copied from interface: RowSetListener
Invoked when the range is scrolled.

Specified by:
rangeScrolled in interface RowSetListener
Parameters:
event - a description of the new range.

rowInserted

public void rowInserted(InsertEvent event)
Description copied from interface: RowSetListener
Invoked when a row has been inserted.

Specified by:
rowInserted in interface RowSetListener
Parameters:
event - a description of the new Row object.

rowDeleted

public void rowDeleted(DeleteEvent event)
Description copied from interface: RowSetListener
Invoked when a row has been deleted.

Specified by:
rowDeleted in interface RowSetListener
Parameters:
event - a description of the deleted Row object.

rowUpdated

public void rowUpdated(UpdateEvent event)
Description copied from interface: RowSetListener
Invoked when an attribute of the row has been changed.

Specified by:
rowUpdated in interface RowSetListener
Parameters:
event - a description of the modified Row object.

navigated

public void navigated(NavigationEvent event)
Description copied from interface: RowSetListener
Invoked when the current-row designation changes.

Specified by:
navigated in interface RowNavigationListener
Specified by:
navigated in interface RowSetListener
Parameters:
event - a description of the new and previous current rows.

createViewLinkAccessor

protected void createViewLinkAccessor(java.lang.String accrName,
                                      java.lang.String voName,
                                      ViewLink vl,
                                      ViewLinkDefImpl vlDef,
                                      ViewObject master,
                                      ViewObject detail,
                                      java.lang.Class javaType)
Internal: Applications should not use this method.


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.

getListBindingDefsInternal

public ListBindingDef[] getListBindingDefsInternal()
Deprecated. Use lookupListBindingDef instead.

For internal use only.

Returns:
the list bindings that are defined on this view object instance. Note that this does not include the definitions in the view definition that this instance is based on.

getByKeyFinderRS

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

Returns the most recently opened rowset for servicing retrieveByKey.

Returns:
the rowset.

createFinderVO

protected ViewObjectImpl createFinderVO(java.lang.String suffix)

bindFinderRS

protected void bindFinderRS(java.lang.Object[] oParams,
                            ViewRowSetImpl finderRS,
                            boolean inclEffDateVals,
                            boolean forceWhereVars)

retrieveByKey

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

retrieveByKey

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

retrieveByKey

protected Row[] retrieveByKey(ViewRowSetImpl rs,
                              java.lang.String keyName,
                              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,
                     java.util.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:

  • public static long XML_OPT_LIMIT_RANGE = 0x00000001 - Controls whether writeXML will only write rows in the range. If this flag is off, all rows in the row set will be written. If this flag is on, only rows in the current range will be written.
  • public static long XML_OPT_CHANGES_ONLY = 0x00000002 - Controls whether only changed attribute values of an entity row is written. If this is on, only the attributes whose value has been marked as "changed" will be written. If this is off, all attributes (regardless of whether the attribute value has been changed or not) will be written. This flag is relevant only when writing EntityImpl.

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,
                     java.util.HashMap voAttrMap,
                     XSLStylesheet xslt)
Specified by:
writeXML in interface XMLInterface

writeXML

public final Node writeXML(int depthCount,
                           long options)
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 writeXML method on ViewObjectImpl traverses the ViewLink accessor for every row in the ViewObject to render detail rows and performs this recursively at each level of the master-detail relationships. This allows writeXML to render rows without disturbing the ViewObject, but also means that new rows in detail rowsets will not be automatically included in the output of writeXML unless the XML_OPT_ASSOC_CONSISTENT option is selected (see below). If readXML is used to load the rendered writeXML output, all ViewObjects which wish to see those new detail rows should themselves be set to viewlink consistent. See readXML for more details.

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, a depthcount of one (1) means traverse the ViewLinks on this object but no ViewLinks thereafter, and so on.

The writeXML method creates default node labels during ViewObjectImpl and ViewRowImpl rendering. The custom properties XML_ELEMENT and XML_ROW_ELEMENT may be used to customize the default element names for ViewObjectImpl and ViewRowImpl respectively. Note that the XML_ELEMENT property must be set on the ViewLink in order to affect the labels of ViewObjectImpl nodes which are generated via View Link traversal. Since this is not currently possible at design time, a runtime workaround is as follows:

  • 1. Get the XML_ELEMENT_NAME property which was set on the ViewObject definition at design time
  • 2. Figure out the accessor name. If your master VO row has a method like get<DetailVO>, then the accessorName = <DetailVO>. You'd have to do this for the VO1 and all its child VOs, if the child VO has a grandchild.
  • 3. Apply the XML_ELEMENT_NAME property to the accessor definition

String propVal = (String)VO1.getProperty(XML_ELEMENT_NAME); VO1.findAttributeDef(<accessorName>).setProperty(XML_ELEMENT_NAME, propVal); VO1.writeXML(...);

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

  • XML_OPT_LIMIT_RANGE - Controls whether writeXML will only write rows in the range. If this flag is off, all rows in the row set will be written. If this flag is on, only rows in the current range will be written.
  • XML_OPT_CHANGES_ONLY - Controls whether only changed attribute values of an entity row is written. If this is on, only the attributes whose value has been marked as "changed" will be written. If this is off, all attributes (regardless of whether the attribute value has been changed or not) will be written. This flag is relevant only when writing EntityImpl.
  • XML_OPT_ASSOC_CONSISTENT - Controls whether attribute accessors that return a RowSet should set the AssociationConsistent flag on, so that new (unposted) rows for the RowSet are also included in the output. When this flag is set, the RowSet used for rendering XML is not set to forward only mode.

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,
                                     java.util.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.

When using readXML in a passivation-enabled environment prior to release 9.0.5, it is recommended to enable viewlink consistency. This may be done at the VM level using -Djbo.viewlink.consistent=true, or at the ViewObjectImpl class level (applying to all instances and both external and internal row sets) by overriding addRowSet() as follows:

protected void addRowSet(ViewRowSetImpl rs) { super.addRowSet(rs); rs.setAssociationConsistent(true); }

For targeted overrides, it's also possible to control viewlink consistency at the ViewObjectImpl instance level by invoking setAssociationConsistent(true).

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.


passivateDynamicAttributeDef

protected void passivateDynamicAttributeDef(java.util.ArrayList dal,
                                            Document doc,
                                            Element parent)
Parameters:
dal - A list of dynamic attribute definitions to passivate
doc - XMLDocument to passivate data in.
parent - Element inside the document to passivate dynamic attributes in.
For internal use only. Application developers should not use this
This method saves out required dynamic attribute definition parameters to recreate them on activation. What is saved is name, type and expression.

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:

  • the current row
  • all fetched rows
  • a subset of rows

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 current row
  • all fetched rows
  • a subset of rows

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


executeQueryForActivation

@Deprecated
protected void executeQueryForActivation(ViewRowSetImpl vrs,
                                                    boolean isEmptyDetail)
Deprecated. Internal use only.

For internal use only. Application developers should not use this
Called by activateNewRowTracker to execute using passivated state.

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.
Returns:
a Row if the application determines this row needs to be maintained in this ViewObject's collection.

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.

activateDynamicAttributeDefs

protected void activateDynamicAttributeDefs(Node dyns)

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(Element, boolean).


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.

Parameters:
amNode - Element node under which this VO's data is being passivated.

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.

getSubclassDefFromStructureDef

public StructureDef getSubclassDefFromStructureDef(StructureDef viewDef)
Strictly Internal: Applications should not use this method.

Called by ViewCriteriaRow to manage subclasses for polymorphic VOs.


getSubclassDef

public StructureDef getSubclassDef(ViewDefImpl viewDef)

bindParametersForCollection

protected void bindParametersForCollection(QueryCollection qc,
                                           java.lang.Object[] params,
                                           java.sql.PreparedStatement stmt)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getRowMatchBindValue

public java.lang.Object getRowMatchBindValue(Row row,
                                             java.lang.String varName)
Specified by:
getRowMatchBindValue in interface RowMatchBindValueSupplier

deepCopy

public RowSet deepCopy(java.util.HashMap voAttrMap,
                       long options)
This method delegates to the default RowSet.

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

resetExecuted

public void resetExecuted()
This method delegates to the default RowSet.

Specified by:
resetExecuted in interface RowSet
See Also:
RowSet.resetExecuted()

buildEffectiveDateFromClauseFragment

protected int buildEffectiveDateFromClauseFragment(java.lang.StringBuffer fromClause,
                                                   int noUserParams)
This method is invoked in a Join VO scenario and ANSI Join Syntax is being followed. The Effective Date fragment must be inserted into the FROM clause instead of the WHERE clause due to ANSI standards.

Parameters:
fromClause - The original from clause
noUserParams - The parameter counter that is used up so far for generating the oracle style bind parameter
Returns:
updates the fromClause in the buffer in-place and returned the new bind index that should be used for future bind parameters.

buildEffectiveDateWhereClauseFragment

protected int buildEffectiveDateWhereClauseFragment(java.lang.StringBuffer effDtClause,
                                                    int noUserParams)
Generates the Effective date filter clause fragment. For example when the binding style is set to Oracle Named Parameter binding style the clause would look like :SysEffectiveDate between effectiveStartDate and effectiveEndDate

Parameters:
effDtClause - The buffer that would contain the generated clause
noUserParams - The parameter counter that is used up so far for generating the oracle style bind parameter
Returns:
the new parameter counter

getDBSortCriteria

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

setDBSortCriteria

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

Specified by:
setDBSortCriteria in interface ViewObject
Parameters:
sortCriteria - an array of database sort criteria with an element for each attribute to sort with

isRuntimeSQLGeneration

public boolean isRuntimeSQLGeneration()
Specified by:
isRuntimeSQLGeneration in interface ViewCriteriaManagerOwner

isSelectAllAttributes

public boolean isSelectAllAttributes()

preFetchRowsByKeys

public void preFetchRowsByKeys(AttributeDef[] keyAttrs,
                               Key[] keys)

preFetchRowsByKeys

public void preFetchRowsByKeys(AttributeDef[] keyAttrs,
                               Key[] keys,
                               Row parentRow)

isAutoRefreshEnabled

public boolean isAutoRefreshEnabled()
Auto Refresh for a View Object is true if it is enabled in the View Definition and belongs to a Shared Application Module.


registerDatabaseChangeListener

protected ADFDatabaseChangeListener registerDatabaseChangeListener(QueryCollection qc,
                                                                   java.sql.Connection conn,
                                                                   java.sql.Statement stmt)
This methood is invoked by the Query Collection to register for database change notifications.

Parameters:
qc - The Query Collection instance
conn - Reference to a connection handle
stmt - The Statement object instantiated by the qc that has the SQL Statement and bind parameters for the database to identify a result set.
Returns:
a handle for the Query Collection to unregister itself.

onDatabaseChangeNotification

protected void onDatabaseChangeNotification(QueryCollection qc,
                                            java.util.EventObject evt)
This method is invoked when the database notifies that the collection of rows in the qc has changed.

Parameters:
qc - The Query Collection that is effected by the change.
evt - The event object that has the details of the nature of the event. For Oracle database platform the event object is an instance of oracle.jdbc.dcn.DatabaseChangeEvent.

processDatabaseChangeNotification

protected void processDatabaseChangeNotification(QueryCollection qc)
This method is invoked during the application's lifecycle determines that it is ready to process queued notifications. It is typically done during the render lifcycle. It is important to make sure that there are no other users using the same collection because their iterators will be reset and may result in unpredictable behavior.

Parameters:
qc - The Query Collection that was notified by the Database.

substituteAttribute

protected void substituteAttribute(ViewAttributeDefImpl existingDef,
                                   ViewAttributeDefImpl replacement)
Strictly Internal: Applications should not use this method.

Substitues a existing view attribute definition with a different one. The replacement must have same name and index.


isEffectiveDated

public boolean isEffectiveDated()
This method returns trueif this view object instance is effective dated. The value returned from this method is same as the value returned by ViewDefImpl.isEffectiveDated() except in the following scenarios: 1. All effective dated entity references in a composite or a declarative view definition are non effective dated 2. None of the attributes from effective dated entity references are marked as selected

Returns:
true if the view object instance is effective dated, false otherwise.

getRowLimit

protected long getRowLimit()
A limit may be applied on the number of rows in a query collection. When a new row is requested from the database and the limit is exceeded a warning is raised. By default the limit is configured as an application wide setting in adf-config.xml.

Returns:
a limit on the number of rows in a query collection. If no row limit is enforced

_internal_dbg_debug_data

protected java.util.List _internal_dbg_debug_data()
framework use only

Returns:
null
For internal use only. Application developers should not use this

findPrimaryKeyColumns

public java.util.Set<java.lang.String> findPrimaryKeyColumns(java.lang.String tableName)

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

E10653-07

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