|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 2 (11.1.2.0.0) E17483-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jbo.common.NamedObjectImpl oracle.jbo.server.NamedObjectImpl oracle.jbo.server.ComponentObjectImpl oracle.jbo.server.ViewObjectImpl
public class ViewObjectImpl
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.
ViewObject
,
RowSet
,
ViewRowSetImpl
Field Summary | |
---|---|
protected static java.lang.String |
DATA_ROWKEYTAG
|
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
|
static int |
VIEW_OBJECT_KIND_ASSOC_ACCESSOR
|
static int |
VIEW_OBJECT_KIND_ECACHE_OVER_RS_BASE
|
static int |
VIEW_OBJECT_KIND_FINDER
|
static int |
VIEW_OBJECT_KIND_JIEXPR_SQL
|
static int |
VIEW_OBJECT_KIND_USER
|
static int |
VIEW_OBJECT_KIND_VALIDATOR
|
static int |
VIEW_OBJECT_KIND_VIEW_ACCESSOR_FOR_EO
|
static int |
VIEW_OBJECT_KIND_VIEW_ACCESSOR_FOR_VROW
|
static int |
VIEW_OBJECT_KIND_VIEW_LINK_ACCESSOR
|
static int |
VIEW_OBJECT_KIND_VL_ACCESSOR_FOR_EO
|
Fields inherited from class oracle.jbo.common.NamedObjectImpl |
---|
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX, RESID_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 AttributeDefImpl |
addViewAccessorDef(ViewAccessorDef vaDef)
Deprecated. |
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. |
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()
This method removes all view criterias from the view object. |
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)
Creates a view row instance from the query result. |
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. |
CategoryManager |
ensureCategoryManager()
Internal Framework use only. |
java.util.Enumeration |
enumerateRowsInRange()
Creates and returns an enumerator of the rows in the range. |
java.lang.Object[] |
executeDetailQuery(Row[] masterRows)
|
void |
executeEmptyRowSet()
Executes the row set as an empty row set. |
void |
executeQuery()
Executes the query. |
protected void |
executeQueryForCollection(java.lang.Object qc,
java.lang.Object[] params,
int noUserParams)
This method is invoked right before the row set executes the query. |
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 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. |
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. |
CategoryManager |
getCategoryManager()
Internal use only. |
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. |
protected java.util.List<Category> |
getOrderedCategories(boolean includeDefaultCategory,
Category.CategoryType categoryType,
LocaleContext locale)
Internal Framework use only. |
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. |
protected double |
getQueryCollectionWeight(QueryCollection qc)
Allows subclasses to customize the weight of the query collection. |
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 whose key matches 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. |
int |
getViewObjectKind()
|
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()
|
protected void |
initSharedQCPoolProperties(QCPoolProperties qcProp)
Allows subclasses to customize QC pool properties during pool initialization. |
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 true if 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 |
isRuntimeSelectFromGeneration()
|
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 |
personalizeTransientExprAndDefValForBeans(ViewAttributeDefImpl vAttr,
java.lang.String pExpr,
java.lang.Object pDefVal)
Deprecated. since 11.1.1.4.0 |
protected void |
personalizeViewAttributeDef(PDefAttribute pAttr,
ViewAttributeDefImpl vAttr)
Deprecated. since 11.1.1.4.0 |
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 |
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 \/*+ |
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.NamedObjectImpl |
---|
setParent, setPropertiesMap |
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 |
Methods inherited from interface oracle.jbo.CategoryManagerOwner |
---|
getName, getProperty, getResourceBundleDef |
Field Detail |
---|
public static final byte FETCH_AS_NEEDED
setFetchMode(byte)
,
Constant Field Valuespublic static final byte FETCH_ALL
setFetchMode(byte)
,
Constant Field Valuespublic static final byte FETCH_DEFAULT
FETCH_AS_NEEDED
.
setFetchMode(byte)
,
Constant Field Valuespublic static final int FULLSQL_MODE_NO_AUGMENTATION
setQuery()
.
setFullSqlMode(int)
,
setQuery(String)
,
Constant Field Valuespublic static final int FULLSQL_MODE_AUGMENTATION
setQuery()
.
setFullSqlMode(int)
,
setQuery(String)
,
Constant Field Valuespublic static final java.lang.String PROPERTY_DEFERRED_ESTIMATED_ROWCOUNT
public static final java.lang.String INTERNAL_EXPR_VALUE_OVERRIDES
public static final int VIEW_OBJECT_KIND_USER
public static final int VIEW_OBJECT_KIND_FINDER
public static final int VIEW_OBJECT_KIND_ASSOC_ACCESSOR
public static final int VIEW_OBJECT_KIND_VIEW_LINK_ACCESSOR
public static final int VIEW_OBJECT_KIND_VL_ACCESSOR_FOR_EO
public static final int VIEW_OBJECT_KIND_VIEW_ACCESSOR_FOR_VROW
public static final int VIEW_OBJECT_KIND_VIEW_ACCESSOR_FOR_EO
public static final int VIEW_OBJECT_KIND_VALIDATOR
public static final int VIEW_OBJECT_KIND_ECACHE_OVER_RS_BASE
public static final int VIEW_OBJECT_KIND_JIEXPR_SQL
protected ViewDefImpl mViewDef
protected java.util.ArrayList mAssocRefs
protected java.lang.String mOptimizerHint
protected java.lang.String mAssocFromClause
protected java.lang.String mAssocClause
protected java.lang.String mUserDefinedQuery
protected java.lang.String mOrderBy
protected java.lang.String mWhere
protected ViewRowSetImpl mViewRowSet
protected volatile java.util.Map mDefaultRowSetMap
protected ViewAttributeDefImpl[] mAttrDefs
protected int mChgAttrIndUseCount
protected int[] mChangedAttrIndices
protected java.util.HashMap mAttrDefsTab
protected ViewAttributeDefImpl[] mKeyAttrRefs
protected boolean mAutoPostChanges
protected int mDynAttrOffset
protected static final java.lang.String QC_TAG
protected static final java.lang.String NEW_ROW_TRACKER
protected static final java.lang.String NEW_ROW_INDEX
protected static final java.lang.String TRANSIENT_DATA_ROWTAG
protected static final java.lang.String DATA_ROWKEYTAG
protected static final java.lang.String NEW_ROW_HANDLE
protected static final java.lang.String ENT_HDL_TRACKER
protected static final java.lang.String ENT_REF_INDEX
protected static final java.lang.String DYN_ATTRS
protected static final java.lang.String DYN_ATTRS_ENTRY
protected static final java.lang.String DYN_ATTRS_NAME
protected static final java.lang.String DYN_ATTRS_TYPE
protected static final java.lang.String DYN_ATTRS_EXPR
protected static final java.lang.String EFFDT_MODE
public static boolean mUsePersColl
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.
public static int mDefaultMaxRowsPerNode
public static int mDefaultMaxActiveNodes
public static final int MIN_ROWS_PER_NODE
public static final int MIN_ACTIVE_NODES
Constructor Detail |
---|
public ViewObjectImpl()
public ViewObjectImpl(java.lang.String name, ViewDefImpl voDef)
name
- the name to be assigned to the View Object.voDef
- a view definition.Method Detail |
---|
public java.lang.String getImageLoc(boolean bOpen)
public final java.lang.Object getSyncLock()
RowSetIterator
ApplicationModule.getSyncLock()
for details.
getSyncLock
in interface RowSetIterator
public final boolean isNameGenerated()
RowSetIterator
isNameGenerated
in interface RowSetIterator
true
if the name was generated by the system.
false
if the name was given by the user and
not generated by the system.public final boolean isInternal()
ViewObject
isInternal
in interface ViewObject
public int getViewObjectKind()
public final ApplicationModule getApplicationModule()
getApplicationModule
in interface RowSet
getApplicationModule
in class ComponentObjectImpl
public java.lang.String getDefName()
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... }
getDefName
in interface ComponentObject
getDefName
in interface StructureDef
getDefName
in class ComponentObjectImpl
public java.lang.String getDefFullName()
The name has the format packageName.ViewDefName.
getDefFullName
in interface ComponentObject
getDefFullName
in interface StructureDef
getDefFullName
in class ComponentObjectImpl
public java.lang.String[] getSubstitutedDefNames()
ViewObject
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.
getSubstitutedDefNames
in interface ViewObject
protected ViewDefImpl getViewDef()
Returns the view definition object from which this View Object was created.
public DefObject getDef()
Returns the definition object from which this View Object was created.
protected void initFromDef()
public void applyPersonalization()
applyPersonalization
in class ComponentObjectImpl
public CategoryManager ensureCategoryManager()
ensureCategoryManager
in interface CategoryManagerOwner
public CategoryManager getCategoryManager()
getCategoryManager
in interface CategoryManagerOwner
null
if one was not yet initialized.protected java.util.List<Category> getOrderedCategories(boolean includeDefaultCategory, Category.CategoryType categoryType, LocaleContext locale)
includeDefaultCategory
- - If the value is true, then the default
category for this View object ( or view def ) is included in the list of the
categories that returned. If the value is false, the default category is
excluded from the list.categoryType
- - this flag tells what type of categories should
the return list contains. If the value is "null", then return list will contain
all type of categories. This value should be of enum type Category.CategoryTypelocale
-
public void resetSelectedAttributeDefs(boolean forceSelectAllAttributes)
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
selectAttributeDefs(String[])
public void resetSelectedAttributeDefs()
resetSelectedAttributeDefs(boolean)
public void selectAttributeDefs(java.lang.String[] attrNameArray)
attrNameArray
- The attributes to activate in the next call to buildQuery or isExecuted
resetSelectedAttributeDefs()
,
unselectAttributeDefs(String[])
public void unselectAttributeDefs(java.lang.String[] attrNameArray)
attrNameArray
- The attributes to activate in the next call to buildQuery or isExecuted
resetSelectedAttributeDefs()
,
selectAttributeDefs(String[])
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.
resetSelectedAttributeDefs()
,
selectAttributeDefs(String[])
,
unselectAttributeDefs(String[])
,
processNewSelectSetSimple()
protected boolean isEntityReferenceSelected(EntityReference eRef)
eRef
- Has this entity reference been selected for the current query
public ViewAttributeDefImpl[] getViewAttributeDefImpls()
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.
public ViewLink[] getViewLinks()
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() == thisThis method should not be overridden.
public java.lang.String[] getViewLinkNames()
A View Link may use this View Object as either its source or destination. This method should not be overridden.
getViewLinkNames
in interface ViewObject
protected void addViewLink(ViewLinkImpl viewLink, boolean isReversed)
public boolean isReadOnly()
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.
isReadOnly
in interface ViewObject
true
if this View Object is
read-only; false if it is updateable.public void setThrowOnListBindingMismatch(boolean b)
For use only in service case where listbindings on the rows of this ViewObject should throw an exception on mismatch.
public boolean throwOnListBindingMismatch()
public java.lang.Object marshalListBindingDefs(java.lang.String subTypeName)
public ListBindingDef lookupListBindingDef(java.lang.String lbName)
ViewObject
lookupListBindingDef
in interface ViewObject
public ListBindingDef findListBindingDef(java.lang.String lbName)
ViewObject
ViewObject.lookupListBindingDef(String)
throws an exception if a listbinding definition of name lbName
is not found.
findListBindingDef
in interface ViewObject
lbName
- listbinding name
protected ApplicationModule getApplicationModuleForLocalViewObject()
protected ViewObject findOrCreateLocalViewObject(java.lang.String usageName)
usageName
- The local view usage name.
protected ViewObject findOrCreateLocalViewObject(java.lang.String usageName, java.lang.String voName)
usageName
- The local view usage name.voName
- Full name the VO to find or create
public QueryCollection getQueryCollection()
Returns the query collection for this View Object's default row set.
public boolean hasDefaultRowSet()
public ViewRowSetImpl getDefaultRowSet()
Gets the default View Row Set.
This Row Set gets the same name as this View Object. This method should not be overridden.
protected ViewRowSetImpl getDefaultRowSetInternal()
public int getQueryTimeOut()
ViewObject
QUERY_TIMEOUT_WAIT_FOREVER
.
getQueryTimeOut
in interface ViewObject
public void setQueryTimeOut(int queryTimeOut)
ViewObject
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()
.
setQueryTimeOut
in interface ViewObject
queryTimeOut
- if non-negative, number of milli-seconds before the
query is timed out. Or, it can be the
QUERY_TIMEOUT_WAIT_FOREVER
constants.public boolean cancelQuery()
RowSet
cancelQuery
in interface RowSet
false
if the JDBC statement is not executing a query.public int getSelectClauseFlags()
public void setSelectClauseFlags(int flags)
public int getFromClauseFlags()
public void setFromClauseFlags(int flags)
public int getWhereClauseFlags()
public void setWhereClauseFlags(int flags)
public java.lang.String getSelectClause()
public void setSelectClause(java.lang.String selClause)
public java.lang.String getFromClause()
public void setFromClause(java.lang.String fromClause)
public java.lang.String getWhereClause()
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
getWhereClause
in interface ViewObject
public void addWhereClause(java.lang.String expr)
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.
expr
- the SQL WHERE clause to be appended.public void setWhereClause(java.lang.String whereClause)
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.
setWhereClause
in interface ViewObject
whereClause
- a SQL WHERE clause.public RowQualifier getRowQualifier()
getRowMatch()
instead.
public void setRowQualifier(RowQualifier rowQualifier)
setRowMatch(oracle.jbo.RowMatch)
instead.
public RowMatch getRowMatch()
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.
getRowMatch
in interface ViewObject
public void setRowMatch(RowMatch rowMatch)
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.
setRowMatch
in interface ViewObject
rowMatch
- the new row match.public RowMatch getRowMatchFromViewCriteria()
protected void setRowMatchFromViewCriteria(RowMatch rowMatch)
protected boolean qualifiesRowFilter(QueryCollection qc, java.lang.Object[] values, int filterOffset)
protected boolean rowQualifies(ViewRowImpl vr)
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.
vr
- the view row to examine.
boolean
value indicating whether the row qualifies
or not.public java.lang.String getOrderByClause()
This method should not be overridden.
getOrderByClause
in interface ViewObject
public void addOrderByClause(java.lang.String expr)
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.
expr
- the SQL ORDER BY expression to be appended.public void setOrderByClause(java.lang.String orderByClause)
The new ORDER BY clause does not take effect until
executeQuery
is called.
This method should not be overridden.
setOrderByClause
in interface ViewObject
orderByClause
- a SQL ORDER BY clause.public java.lang.String getSortBy()
getSortBy
in interface ViewObject
ViewObject.setSortBy(String)
public void setSortBy(java.lang.String sortBy)
ViewObject
setSortBy
in interface ViewObject
sortBy
- in-memory sort clauseprotected void processSortCriteria()
public SortCriteria[] getSortCriteria()
public java.lang.Object[] getWhereClauseParams()
This method should not be overridden.
getWhereClauseParams
in interface RowSet
public boolean isExecuted()
isExecuted
in interface RowSet
public void setWhereClauseParams(java.lang.Object[] values)
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.
setWhereClauseParams
in interface RowSet
values
- an array of bind values.public void setReqdVC(ViewCriteria vc)
setRequiredViewCriteria()
instead.
public void setRequiredViewCriteria(ViewCriteria vc)
ViewObject
getViewCriteriaManager().clearViewCriterias
or
getViewCriteriaManager().removeViewCriteria
API.
setRequiredViewCriteria
in interface ViewObject
vc
- Set the criteria as required view criteria for this view object instance.public ViewCriteria getReqdVC()
getRequiredViewCriteria()
instead.
public ViewCriteria getRequiredViewCriteria()
ViewObject
ViewObject.setRequiredViewCriteria(oracle.jbo.ViewCriteria)
getRequiredViewCriteria
in interface ViewObject
public void refreshWhereClauseParams()
refreshWhereClauseParams
in interface WSRowSetMarshaller
public void defineNamedWhereClauseParam(java.lang.String name, java.lang.Object defaultValue, int[] indices)
RowSet
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
to apply the new bind
value.
RowSet.executeQuery()
defineNamedWhereClauseParam
in interface RowSet
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.public void removeNamedWhereClauseParam(java.lang.String name)
RowSet
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
for the removal to take
effect.
RowSet.executeQuery()
removeNamedWhereClauseParam
in interface RowSet
name
- the name of the where-clause parameter to remove.public java.lang.Object getNamedWhereClauseParam(java.lang.String name)
RowSet
If the view object owns multiple row sets, each row set may have its own (different) named where-clause parameter value.
getNamedWhereClauseParam
in interface RowSet
name
- the name of the where-clause parameter.public void setNamedWhereClauseParam(java.lang.String name, java.lang.Object value)
RowSet
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
to apply the new bind
value.
RowSet.executeQuery()
setNamedWhereClauseParam
in interface RowSet
name
- the name of the where-clause parameter.value
- the where-clause parameter value for this row set.public void skipNamedWhereClauseParam(java.lang.String name)
RowSet
Skipping a named where-clause parameter
does not automatically execute the query. You must call
for the skip to take
effect.
RowSet.executeQuery()
skipNamedWhereClauseParam
in interface RowSet
name
- the name of the where-clause parameter.public void setWhereClauseParam(int index, java.lang.Object value)
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.
setWhereClauseParam
in interface RowSet
index
- the position of the bind value.value
- the bind value.public void setNamedWhereClauseParams(AttributeList attrlist)
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.
setNamedWhereClauseParams
in interface RowSet
attrlist
- the array of name, value pairs of bind variables.public AttributeList getNamedWhereClauseParams()
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);
getNamedWhereClauseParams
in interface RowSet
public DBTransaction getDBTransaction()
This method should not be overridden.
public boolean shouldPutJoinConstraintInWhereClause()
shouldPutJoinConstraintInWhereClause
in interface ViewCriteriaManagerOwner
public int getFullSqlMode()
public void setFullSqlMode(int fullSqlMode)
public java.lang.String getUserDefinedQuery()
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.
public void setNestedSelectForFullSql(boolean b)
public boolean isViewLinkAccessorRetained()
public void setViewLinkAccessorRetained(boolean b)
public java.lang.String getQuery()
getUserDefinedQuery
this method will return a SQL statement regardless of whether the query
was created in Expert or non-Expert Mode.
getQuery
in interface ViewObject
public java.lang.String getQueryHint()
public void setQueryHint(java.lang.String queryHint)
public java.lang.String buildSubquery(AttributeDef[] attrsToSelect, java.lang.String whereClause, AttributeDef accessor, ViewCriteria nestedVC)
buildSubquery
in interface ViewCriteriaClauseBuilder
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)
public void prepareRowSetForQuery(ViewRowSetImpl vrs)
public void prepareVOForQuery()
protected java.lang.String buildRangePagingQuery(java.lang.String qry, int noUserParams)
protected void bindRangePagingParams(java.sql.PreparedStatement stmt, int nextParamIndex, int rangeStart, int rangeSize)
public long getQueryHitCount(ViewRowSetImpl viewRowSet)
This method obtains the row count by executing:
SELECT COUNT(1) FROM query-statement ESTCOUNTBased on the value returned, you might want to adjust the JDBC row prefetch size.
public long getQueryHitCount(ViewRowSetImpl viewRowSet, Row[] masterRows)
public long getCappedQueryHitCount(ViewRowSetImpl viewRowSet, Row[] masterRows, long oldCap, long cap)
cap
argument
so that we can execute a query that aborts the count as soon
as the cap is met.
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
protected java.lang.String buildSelectClause()
protected java.lang.String buildFromClause()
protected boolean buildWhereClause(java.lang.StringBuffer sqlBuffer, int noUserParams)
The WHERE clause is made up of the following parts:
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
.
true
if a WHERE clause was appended.protected boolean buildOrderByClause(java.lang.StringBuffer sqlBuffer, java.lang.String defOrderByClause)
The order-by-clause is made up of the following parts:
sqlBuffer
- StringBuffer
into which the
order-by-clause is appended.defOrderByClause
- order-by-clause from the definition object.
true
if an order-by-clause was appended.public void setQuery(java.lang.String 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.
query
- a user-defined query statement.
InvaildOperException
- if this method is called on a
View Object that is a detail of a View Link.public java.lang.Object[] getParametersAsStorageTypes()
The resulting array is a union of the following sets of bind values:
setWhereClauseParam()
.
null
if none.public java.lang.Class getRowClass()
ViewRowImpl
public ViewDefImpl findViewDefFromDiscrVals(java.sql.ResultSet resultSet, AttributeList initValues)
public ViewDefImpl findViewDefFromDiscrVals(java.sql.ResultSet resultSet, AttributeList initValues, EntityImpl[] entities)
public ViewRowImpl createInstance(ViewRowSetImpl viewRowSet, AttributeList attrValList)
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.
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.
createRow()
protected ViewRowImpl createInstanceWithEntities(int[] eoIndices, EntityImpl[] entities, ViewRowSetImpl viewRowSet, AttributeList attrValList)
public ViewRowImpl createInstanceFromResultSet(QueryCollection qc, java.sql.ResultSet resultSet)
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.
qc
- query collection.resultSet
- JDBC ResultSet
.
protected ViewRowImpl createNewRowForCollection(java.lang.Object qc)
protected ViewRowImpl createAndInitRowForCollection(java.lang.Object qc, AttributeList initVals)
protected void populateAttributeForRow(ViewRowImpl row, int index, java.lang.Object value)
protected int[] getDiscrColLoadIndices()
protected ViewRowImpl createRowFromResultSet(java.lang.Object iqc, java.sql.ResultSet resultSet)
protected int getEntityDefCount()
Returns the number of entity bases.
protected EntityDefImpl getEntityDef(int index)
Returns the definition of an entity base at the specified index.
index
- entity base index.
protected EntityDefImpl[] getEntityDefs()
This method could be used to perform meta-data initializations like "custom" Properties that are calculated using the current transaction.
protected int[] getLockParticipants()
Returns an array of indices of entity bases that participate in processing the lock operation of the view row.
protected int[] getDeleteParticipants()
Returns an array of indices of entity bases that participate in processing the delete (remove) operation of the view row.
protected int[] getInsertParticipants()
Returns an array of indices of entity bases that participate in processing the insert operation of the view row.
public ViewAccessorDef lookupViewAccessorDef(java.lang.String vaName)
public ViewAccessorDef findViewAccessorDef(java.lang.String name)
public java.util.ArrayList getViewAccessorDefsInternal()
protected AttributeDefImpl addViewAccessorDef(ViewAccessorDef vaDef)
public OperationDefinitionsImpl getOperationDefinitions()
public OperationDefinitionsImpl getRowOperationDefinitions()
protected void personalizeViewAttributeDef(PDefAttribute pAttr, ViewAttributeDefImpl vAttr)
protected void personalizeTransientExprAndDefValForBeans(ViewAttributeDefImpl vAttr, java.lang.String pExpr, java.lang.Object pDefVal)
public void hideAttributeDef(java.lang.String attrName)
public AttributeDef[] getAttributeDefs()
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.
getAttributeDefs
in interface StructureDef
public boolean isAttributeKey(AttributeDef attrDef)
public AttributeDef[] getKeyAttributeDefs()
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.
getKeyAttributeDefs
in interface ViewObject
public KeyDef lookupAltKeyDef(java.lang.String keyName)
public KeyDef findAltKeyDef(java.lang.String keyName)
public AttributeDef[] getAltKeyAttrDefs(java.lang.String keyName)
public AttributeDef[] getAttrDefsForEntityAttr(java.lang.String eoName, java.lang.String eoAttrName)
getAttrIndicesForEntityAttr
, except that it
return an array of attribute definitions, not just indices.
getAttrDefsForEntityAttr
in interface ViewObject
eoName
- fully qualified name of the entity object.eoAttrName
- entity object attribute name.
getAttrIndicesForEntityAttr(String, String)
public int[] getAttrIndicesForEntityAttr(java.lang.String eoName, java.lang.String eoAttrName)
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.
eoName
- fully qualified name of the entity object.eoAttrName
- entity object attribute name.
public int getCalculatedAttributeCount()
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.
public AttributeDefImpl[] getPrimaryKeys()
protected java.lang.String getAssociationClause(int noUserParams)
Returns the where-clause expression generated from View Links.
public void executeQuery()
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()
.
executeQuery
in interface RowSet
setFetchMode(byte)
,
RowSetListener.rangeRefreshed(oracle.jbo.RangeRefreshEvent)
,
RangeRefreshEvent
public void forceExecuteQueryOfSharedVO()
public void executeEmptyRowSet()
RowSet
executeEmptyRowSet
in interface WSRowSetMarshaller
executeEmptyRowSet
in interface RowSet
public java.lang.Object[] executeDetailQuery(Row[] masterRows)
executeDetailQuery
in interface WSRowSetMarshaller
public java.util.Comparator getRowComparator()
public void sortRows(Row[] rows)
protected void executeQueryForCollection(java.lang.Object qc, java.lang.Object[] params, int noUserParams)
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.
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.protected void setResultSetForCollection(java.lang.Object qc, java.sql.ResultSet rs)
protected boolean hasNextForCollection(java.lang.Object qc)
protected void setFetchCompleteForCollection(java.lang.Object qc, boolean val)
protected java.lang.Object getUserDataForCollection(java.lang.Object qc)
protected void setUserDataForCollection(java.lang.Object qc, java.lang.Object data)
protected void releaseUserDataForCollection(java.lang.Object qc, java.lang.Object data)
protected final int getRangePageStartForCollection(java.lang.Object qc)
public int getAttributeCount()
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.
getAttributeCount
in interface StructureDef
public AttributeDef findAttributeDef(java.lang.String name)
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 clauseThis method should not be overridden.
findAttributeDef
in interface StructureDef
name
- the name of the attribute.
name
.
InvalidDefNameException
- if the name
is invalid.
NoDefException
- if the attribute is not found.public AttributeDef lookupAttributeDef(java.lang.String name)
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 clauseThis method should not be overridden.
lookupAttributeDef
in interface AttributeDependencyManager
lookupAttributeDef
in interface StructureDef
name
- the name of the attribute.
name
or null if no
attribute was found.
InvalidDefNameException
- if the name
is invalid.public AttributeDef getAttributeDef(int index)
// 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.
getAttributeDef
in interface StructureDef
index
- the position of the attribute definition.
null
if the index is
out of range.public java.lang.String getColumnNameForQuery(int index)
getColumnNameForQuery
in interface StructureDef
public int getDynamicAttributeCount()
Returns the number of dynamic attributes.
getDynamicAttributeCount
in interface ViewObjectDynAttr
public int getDynamicAttributeOffset()
Returns the attribute index of the first dynamic attribute.
getDynamicAttributeOffset
in interface ViewObjectDynAttr
public AttributeDef addDynamicAttribute(java.lang.String attrName)
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.
addDynamicAttribute
in interface ViewObject
attrName
- the name of the dynamic attribute.
NameClashException
- if an attribute of the same name already exists.public AttributeDef addDynamicAttributeWithType(java.lang.String attrName, java.lang.String javaTypeName, java.lang.String transientExpression)
addDynamicAttributeWithType
in interface ViewObject
public int getAttributeIndexOf(java.lang.String attrName)
For example:
int idxQuantity = this.getAttributeIndexOf("Quantity");This method should not be overridden.
getAttributeIndexOf
in interface StructureDef
attrName
- the name of the attribute.
NoDefException
- if the attribute is not found.public boolean isDynamicAttribute(int index)
This method should not be overridden.
index
- the attribute's position.
true
if the attribute is dynamic;
false
otherwise.public boolean isDynamicAttribute(java.lang.String name)
This method should not be overridden.
name
- the attribute'same.
true
if the attribute is dynamic, or
false
otherwise.public java.util.List getBackwardDependencyAttributes(java.lang.String attrName)
getBackwardDependencyAttributes
in interface AttributeDependencyManager
public java.util.List getForwardDependencyAttributes(java.lang.String attrName)
getForwardDependencyAttributes
in interface AttributeDependencyManager
getForwardDependencyAttributes
in interface ViewObject
public java.util.HashSet<java.lang.String> getBackwardDependencies(java.lang.String attrName)
getBackwardDependencies
in interface AttributeDependencyManager
public java.util.HashSet<java.lang.String> getForwardDependencies(java.lang.String attrName)
getForwardDependencies
in interface AttributeDependencyManager
public void addForwardDependency(java.lang.String attrName, java.lang.String depName)
addForwardDependency
in interface AttributeDependencyManager
public void validate()
This method enumerates through all rows in the row set and calls
validate()
on any that have been modified.
ValidationException
- if validation fails for any row.ViewRowImpl.validate()
public boolean isAutoPostChanges()
If true, changes are automatically posted to the database before the View Object's query is executed.
public void setAutoPostChanges(boolean bAutoPostChanges)
If enabled, changes are automatically posted to the database before the View Object's query is executed.
bAutoPostChanges
- true enables auto-post-changes.protected QueryCollection getCachedQueryCollection(RowFilter rowFilter)
Returns the QueryCollection
associated with the
key
rowFilter
- the row filter for the query collection.
null
otherwise.protected java.util.Enumeration getAllCachedQueryCollections()
protected void unpinDetailQC(QueryCollection qc)
protected RowFilter buildRowFilter(java.lang.Object[] paramValues)
protected java.util.Enumeration getRowFilters()
protected boolean isCollectionPresent(RowFilter rowFilter)
protected RowFilter[] getQualifyingRowFilters(java.lang.Object[] rowParamValues)
protected RowFilter buildNewCollection(java.lang.Object[] newParamValues)
protected RowFilter[] buildQualifyingRowFilters(java.lang.Object[] newParamValues)
protected void markQueryCollectionDirty(QueryCollection qc, boolean isDirty)
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.
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.QueryCollection.setDirty(boolean)
public byte getFetchMode()
For more information on fetch modes, see setFetchMode
.
setFetchMode(byte)
protected void setFetchMode(byte fetchMode)
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 ResultSet
s. 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 ResultSet
s.
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.
fetchMode
- the new fetch mode. Can be FETCH_ALL or FETCH_AS_NEEDED.public int getBindingStyle()
public void setBindingStyle(int bindingStyle)
bindingStyle
- the binding style. Can be one of BINDING_STYLE_ORACLE, BINDING_STYLE_JDBC, or
BINDING_STYLE_UNKNOWN.protected ViewLinkAccessorInfo getViewLinkAccessorInfo()
public short getFetchSize()
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.
public int getMaxFetchSize()
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.
getMaxFetchSize
in interface ViewObject
public void setFetchSize(short 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. 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.
size
- number of rows to fetch from the database. 1 is the default.setFetchMode(byte)
public void setMaxFetchSize(int size)
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().
setMaxFetchSize
in interface ViewObject
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.public int getQueryMode()
ViewObject
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
.
getQueryMode
in interface ViewObject
public void setQueryMode(int queryMode)
ViewObject
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
.
setQueryMode
in interface ViewObject
queryMode
- the new query mode.public void addQueryMode(int queryMode)
ViewObject
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.
addQueryMode
in interface ViewObject
queryMode
- the new query mode to be added (OR'ed).public ViewCriteria createViewCriteria()
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.
createViewCriteria
in interface ViewObject
ViewCriteria
,
applyViewCriteria(ViewCriteria)
protected boolean addViewCriteriaToWhereClause()
public ViewCriteriaManager getViewCriteriaManager()
getViewCriteriaManager
in interface ViewCriteriaManagerOwner
getViewCriteriaManager
in interface ViewObject
public ViewCriteriaManager getViewCriteriaManagerInternal()
public void applyViewCriteria(ViewCriteria criteria)
ViewObject
applyViewCriteria
in interface ViewCriteriaManager
applyViewCriteria
in interface ViewObject
criteria
- view criteria to be appliedpublic void applyViewCriteria(ViewCriteria criteria, boolean bAppend)
ViewObject
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.
applyViewCriteria
in interface ViewCriteriaManager
applyViewCriteria
in interface ViewObject
criteria
- view criteria to be appliedbAppend
- flag to indicate if the applied view criteria list needs to
be cleared before applying the view criteria.public void clearViewCriterias()
setApplyViewCriteriaName
.
Instead you would need to add the view criteria back to the view
object by calling
putViewCriteria
or
applyViewCriteria
.
If instead it is your intention to simply unapply the view
criterias rather than physically remove them from the view
object you should call
setApplyViewCriteriaName
passing in a null parameter or simply apply another view criteria
without appending to the already applied view criterias.
clearViewCriterias
in interface ViewCriteriaManager
public ViewCriteria getViewCriteria()
This method should not be overridden.
getViewCriteria
in interface ViewCriteriaManager
getViewCriteria
in interface ViewObject
null
if none is specified.public ViewCriteria getViewCriteria(java.lang.String name)
ViewCriteriaManager
getViewCriteria
in interface ViewCriteriaManager
name
- view criteria name
public void putViewCriteria(java.lang.String name, ViewCriteria vc)
ViewCriteriaManager
putViewCriteria
in interface ViewCriteriaManager
name
- Name of the view criteriavc
- view criteria referencepublic ViewCriteria removeViewCriteria(java.lang.String name)
ViewCriteriaManager
removeApplyViewCriteriaName
API.
removeViewCriteria
in interface ViewCriteriaManager
name
- The view criteria name that needs to be removed
public java.lang.String[] getApplyViewCriteriaNames()
getApplyViewCriteriaNames
in interface ViewCriteriaManager
public void setApplyViewCriteriaNames(java.lang.String[] names)
ViewCriteriaManager
setApplyViewCriteriaNames
in interface ViewCriteriaManager
names
- the criterias to be applied.public void setApplyViewCriteriaName(java.lang.String name)
ViewCriteriaManager
setApplyViewCriteriaName
in interface ViewCriteriaManager
name
- the criteria to be applied.public void setApplyViewCriteriaName(java.lang.String name, boolean bAppend)
ViewCriteriaManager
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)
setApplyViewCriteriaName
in interface ViewCriteriaManager
name
- the criteria to be appliedbAppend
- pass true
if the view criteria needs to be appended to
the applied list otherwise the list is cleared out.public java.lang.String[] getApplyJoinedViewCriteriaNames()
public void setApplyJoinedViewCriteriaNames(java.lang.String[] names)
public boolean removeApplyViewCriteriaName(java.lang.String name)
ViewCriteriaManager
removeApplyViewCriteriaName
in interface ViewCriteriaManager
name
- The view criteria name that need to be unapplied.
true
if the view criteria was found to be applied,
false
otherwise.public ViewCriteria[] getApplyAllViewCriterias(int criteriaMode, boolean getAllReqdVC)
public ViewCriteria[] getApplyViewCriterias(int criteriaMode)
ViewCriteriaManager
ViewCriteria.CRITERIA_MODE_CACHE
and
ViewCriteria.CRITERIA_MODE_QUERY
for more information. View criterias
that have both modes turned on are also qualified.
getApplyViewCriterias
in interface ViewCriteriaManager
criteriaMode
- the mode to match the criteria.
public void setCurrentUnionViewCriteriaName(java.lang.String vcName)
setCurrentUnionViewCriteriaName
in interface ViewCriteriaManager
public java.lang.String[] getAllViewCriteriaNames()
ViewCriteriaManager
getAllViewCriteriaNames
in interface ViewCriteriaManager
public java.lang.String[] getAvailableViewCriteriaNames()
ViewCriteriaManager
getAvailableViewCriteriaNames
in interface ViewCriteriaManager
public ViewCriteria[] getAllViewCriterias()
ViewCriteriaManager
getAllViewCriterias
in interface ViewCriteriaManager
public void setViewCriteriaAdapter(ViewCriteriaAdapter adapter)
public CriteriaClauses buildViewCriteriaClauses(ViewCriteria vc)
ViewCriteriaManager
ViewCriteriaManager.getViewCriteriaClause(boolean)
buildViewCriteriaClauses
in interface ViewCriteriaClauseBuilder
buildViewCriteriaClauses
in interface ViewCriteriaManager
vc
- the view criteria whose criteria needs to be generated
public java.lang.String getViewCriteriaClause()
This method should not be overridden.
public java.lang.String getViewCriteriaClause(boolean forQuery)
getViewCriteriaClause
in interface ViewCriteriaManager
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.
public CriteriaAdapter getCriteriaAdapter()
public java.lang.String getCriteriaItemClause(ViewCriteriaItem vci)
vci
- The ViewCriteriaItem from which a where clause fragment should
be generated for.
protected boolean applyBindVariableForCriteria(ViewCriteria criteria, Variable variable, java.lang.Object variableValue)
criteria
- for which framework is seeking to apply bind variables on the jdbc statement.public AttributeHints getCriteriaItemAttributeHints(ViewCriteriaItem vci)
getCriteriaItemAttributeHints
in interface ViewObject
public void criteriaChanged(ViewCriteria vc)
ViewCriteriaManager
criteriaChanged
in interface ViewCriteriaManagerOwner
criteriaChanged
in interface ViewCriteriaManager
vc
- the view criteria that has changedpublic void criteriaSelReqBindVarsChanged(ViewCriteria vc)
public void resetCriteria(ViewCriteria vc)
ViewCriteriaManager
resetCriteria
in interface ViewCriteriaManager
vc
- View Criteria to be resetpublic boolean isForScan()
public AttributeDef[] getScanRowFilterAttributeDefs()
public void setKeyAttributeDefs(int[] keyIndices)
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
public boolean isManageRowsByKey()
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.
public void setManageRowsByKey(boolean manageRowsByKey)
isManageRowsByKey()
for explanation of
flag.
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.public RowSet getRowSet()
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.
getRowSet
in interface RowSetIterator
RowSetIterator.getRowSet()
public RowSetIterator getRowSetIterator()
public Row next()
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
RowSetListener
s.
When successful, this method fires a
NavigationEvent
to registered
RowSetListener
s, by calling
RowSetListener.navigated()
. The row returned is
designated as the current row.
next
in interface RowIterator
null
if no next row.
ValidationException
- if the prevously current row fails
validation.NavigationEvent
,
RowSetListener
,
ScrollEvent
,
ViewRowImpl.validate()
public Row previous()
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 registeredRowSetListener
s.
When successful, this method fires a
NavigationEvent
to registered
RowSetListener
s, by calling
RowSetListener.navigated()
. The row returned is designated as
the current row.
previous
in interface RowIterator
null
if no previous row.
ValidationException
- if the prevously current row fails
validation.NavigationEvent
,
RowSetListener
,
ScrollEvent
,
ViewRowImpl.validate()
public Row first()
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
RowSetListener
s.
When successful, this method fires a
NavigationEvent
to registered RowSetListener
s, by calling
RowSetListener.navigated()
. The row returned is designated as
the current row.
first
in interface RowIterator
null
if the set has no rows.
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.NavigationEvent
,
RowSetListener
,
ViewRowImpl.validate()
public Row last()
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 RowSetListener
s.
When successful, this method fires a
NavigationEvent
to registered RowSetListener
s, by calling
RowSetListener.navigated()
. The row returned is designated as
the current row.
last
in interface RowIterator
null
if the set has no rows.
ValidationException
- if the prevously current row fails
validation.NavigationEvent
,
RowSetListener
,
ViewRowImpl.validate()
public boolean doesRowFilterMatch(Row[] masterRows, java.lang.Object[] rowFilterValues)
doesRowFilterMatch
in interface WSRowSetMarshaller
public java.lang.Object[] refreshCollection(Row[] masterRows, boolean resetIter, boolean fillUpRange)
refreshCollection
in interface WSRowSetMarshaller
public void reset()
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.
reset
in interface RowIterator
public boolean hasNext()
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.
hasNext
in interface RowIterator
true
if the row set has a next row, or
false
if not.public boolean hasPrevious()
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.
hasPrevious
in interface RowIterator
true
if the row set a previous row, or
false
if not.public boolean isRangeAtBottom()
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.
isRangeAtBottom
in interface RowIterator
true
if the range contains the last row, or
false
if not.public boolean isRangeAtTop()
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.
isRangeAtTop
in interface RowIterator
true
if the range contains the first row, or
false
if not.public int getFetchedRowCount()
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.
getFetchedRowCount
in interface RowIterator
public int getRowCount()
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); }
getRowCount
in interface RowIterator
getEstimatedRowCount()
public boolean adjustERCWithChangedRows()
public long getEstimatedRowCount()
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.
getEstimatedRowCount
in interface RowSet
getQueryHitCount(ViewRowSetImpl)
,
getFetchedRowCount()
public long getDeferredEstimatedRowCount()
RowSet
getDeferredEstimatedRowCount
in interface RowSet
public long getDetailEstimatedRowCount(Row[] masterRows)
getDetailEstimatedRowCount
in interface WSRowSetMarshaller
public long getCappedRowCount(long cap)
cap
argument
so that we can execute a query that aborts the count as soon
as the cap is met.
getCappedRowCount
in interface RowSet
cap
- the limit on the count expected
-cap
number if the row count is possibly greater than the cap
.protected java.lang.Boolean getDeferEstimatedRowCountProperty()
public java.lang.Object[] getRowFilterValues()
getRowFilterValues
in interface WSRowSetIteratorMarshaller
public void setRowFilterValues(java.lang.Object[] rowFilterValues)
setRowFilterValues
in interface WSRowSetIteratorMarshaller
public SvcMsgIteratorState getCliIteratorState()
getCliIteratorState
in interface WSRowSetIteratorMarshaller
public void prepareForBatchMode(SvcMsgIteratorState iteratorState, boolean setCurrentRow)
prepareForBatchMode
in interface WSRowSetIteratorMarshaller
public int getDefaultRangeSize()
public void setDefaultRangeSize(int i)
public int setRangeSize(int size)
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);
setRangeSize
in interface RowIterator
size
- the new range size, or -1 if all rows are to be included.
InvalidOperException
- if the iterator is forward-only and
size
is greater than 1.RowIterator.setRangeStart(int)
public int getRangeSize()
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());
getRangeSize
in interface RowIterator
public int getRangeStart()
An absolute row index is a row index in the entire row set.
For an example usage of this method, see setRangeStart
getRangeStart
in interface RowIterator
public int setRangeStart(int start)
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());
setRangeStart
in interface RowIterator
start
- an absolute row index.
ScrollEvent
,
RowSetListener
public int scrollRange(int amount)
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 RowSetListener
s.
scrollRange
in interface RowIterator
amount
- the number of rows to scroll.
InvalidOperException
- if this method is called on
on a forward-only row set and amount
is negative.ScrollEvent
,
RowSetListener
public int scrollToRangePage(int amount)
RowSetIterator
(rangeSize * (pageSize-1)) - getRangeStart();
scrollToRangePage
in interface RowSetIterator
amount
- the page number to go to in the result set.
public int getEstimatedRangePageCount()
RowSetIterator
This number may fluxuate when the View Object is syncronized with its Entity Object.
getEstimatedRangePageCount
in interface RowSetIterator
public int scrollRangeTo(Row row, int index)
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 RowSetListener
s.
scrollRangeTo
in interface RowIterator
row
- the row to scroll the range to.index
- the range index at which row is to be positioned.
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.ScrollEvent
,
RowSetListener
public Row getRow(Key key)
key
.
See
for details.
oracle.jbo.RowIterator#getKey(oracle.jbo.Key)
getRow
in interface RowIterator
key
- the key to be matched.
null
if none match.findByKey(Key, int)
public Row getRowAtRangeIndex(int index)
getRowAtRangeIndex
in interface RowIterator
index
- a zero-based index within the range.
null
if index
is outside of the range.public Row getRowFromHandle(java.lang.Object hdl)
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.
hdl
- the row handle.
ViewRowImpl.getHandle()
,
ViewRowImpl.getKey()
public void removeRowHandle(java.lang.Object hdl)
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.
hdl
- the row handle to remove.ViewRowImpl.getHandle()
public Row getCurrentRow()
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).
getCurrentRow
in interface RowIterator
null
if no current row.public int getCurrentRowIndex()
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.
getCurrentRowIndex
in interface RowIterator
public int getCurrentRowSlot()
The current row's slot status is one of the following
oracle.jbo.RowIterator
constants:
The following example uses a switch statement to return a different string message based on the value returned by this method.
public String getCurrentRowSlot() { switch (mViewObject.getCurrentRowSlot()) { case mViewObject.SLOT_VALID: return new String("SLOT_VALID"); case mViewObject.SLOT_DELETED: return new String("SLOT_DELETED"); case mViewObject.SLOT_BEFORE_FIRST: return new String("SLOT_BEFORE_FIRST"); case mViewObject.SLOT_BEYOND_LAST: return new String("SLOT_BEYOND_LAST"); }
getCurrentRowSlot
in interface RowIterator
RowIterator
public int getIterMode()
RowIterator
getIterMode
in interface RowIterator
public void setIterMode(int mode)
RowIterator
setIterMode
in interface RowIterator
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".public boolean isRowValidation()
RowIterator
isRowValidation
in interface RowIterator
public void setRowValidation(boolean flag)
RowIterator
setRowValidation
in interface RowIterator
flag
- Whether to turn row validation off or not.public boolean setCurrentRow(Row 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 RowSetListener
s.
setCurrentRow
in interface RowIterator
row
- the row that is to become the current row.
ValidationException
- if the previous current row fails
validation.NavigationEvent
,
RowSetListener
,
ViewRowImpl.validate()
public boolean setCurrentRowAtRangeIndex(int index)
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 RowSetListener
s.
setCurrentRowAtRangeIndex
in interface RowIterator
index
- the position of the row that is to become the current row.
ValidationException
- if the previous current row fails
validation.NavigationEvent
,
RowSetListener
,
ViewRowImpl.validate()
public Row createAndInitRow(AttributeList initVals)
RowIterator
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.
createAndInitRow
in interface RowIterator
initVals
- a list of name-value pairs.
public Row createRow()
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);
createRow
in interface RowIterator
public void insertRow(Row row)
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 RowSetListener
s.
If you want to insert a row but not change currency consider using
insertRowAtRangeIndex
.
insertRow
in interface RowIterator
row
- the view row to insert.public void insertRowAtRangeIndex(int index, Row row)
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 RowSetListener
s.
insertRowAtRangeIndex
in interface RowIterator
index
- the range index at which row is to be inserted.row
- the view row to insert.public void removeCurrentRow()
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 RowSetListener
s.
removeCurrentRow
in interface RowIterator
RowSetListener.rowDeleted(oracle.jbo.DeleteEvent)
public void removeCurrentRowFromCollection()
RowIterator
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
, change currency
to the desired location, and then call RowIterator.removeCurrentRowAndRetain()
with that row.
RowIterator.insertRow(oracle.jbo.Row)
removeCurrentRowFromCollection
in interface RowIterator
public Row removeCurrentRowAndRetain()
RowIterator
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
in that after the current row is removed from the collection, it can be
inserted back into the collection at another location.
RowIterator.removeCurrentRowFromCollection()
To do so, call
,
and get the returning row. Then, change currency to the desired location,
and call RowIterator.removeCurrentRowAndRetain()
with
that row.
RowIterator.insertRow(oracle.jbo.Row)
removeCurrentRowAndRetain
in interface RowIterator
public int getRangeIndexOf(Row row)
getRangeIndexOf
in interface RowIterator
row
- a row.
public java.util.Enumeration enumerateRowsInRange()
enumerateRowsInRange
in interface RowIterator
public Row[] getAllRowsInRange()
getAllRowsInRange
in interface RowIterator
public Row[] getNextRangeSet()
RowSetIterator
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
to be sent to ScrollEvent
.
To pick up such an event, the listener object must implement the
RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent)
interface. Further, this listener
must be registered through a call to
RowSetListener
(the listener object passed in as the parameter to
NavigatableRowIterator.addListener(Object)
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
and sends it to
NavigationEvent
.
RowSetListener.navigated(oracle.jbo.NavigationEvent)
getNextRangeSet
in interface RowSetIterator
public Row[] getPreviousRangeSet()
RowSetIterator
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
to be sent to ScrollEvent
.
To pick up such an event, the listener object must implement the
RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent)
interface. Further, this listener
must be registered through a call to
RowSetListener
(the listener object passed in as the parameter to
NavigatableRowIterator.addListener(Object)
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
and sends it to
NavigationEvent
.
RowSetListener.navigated(oracle.jbo.NavigationEvent)
getPreviousRangeSet
in interface RowSetIterator
public ViewObject getViewObject()
RowSet
If this row set is the result of calling a view link accessor,
the returned view object is an internal view object.
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"):
ViewObject.isInternal()
RowSet detailRS = (RowSet) masterViewRow.getMyDetail(); ViewObject detailVO = detailRS.getViewObject();
getViewObject
in interface RowSet
public boolean isDefaultRowSet()
isDefaultRowSet
in interface RowSet
public boolean setMasterRowSetIterator(RowSetIterator masterRSI)
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.
setMasterRowSetIterator
in interface RowSet
masterRSI
- a master row set iterator.
public boolean removeMasterRowSetIterator(RowSetIterator masterRSI)
If masterRSI
is a master row set iterator for this
row set, it is removed from the list of master row set
iterators.
removeMasterRowSetIterator
in interface RowSet
masterRSI
- master row set iterator to be removed.
public RowSetIterator[] getMasterRowSetIterators()
getMasterRowSetIterators
in interface RowSet
public RowSet[] getDetailRowSets()
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.
getDetailRowSets
in interface RowSetIterator
RowSet
.public RowSet createDetailRowSet(java.lang.String rsName, java.lang.String linkDefName)
getDetailRowSets()
for explanation of detail Row Sets.
This method creates a new detail Row Set for this Iterator.
createDetailRowSet
in interface RowSetIterator
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).
public void addListener(java.lang.Object listener)
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.
addListener
in interface NavigatableRowIterator
listener
- a RowSetListener
instance.RowSetListener
public void removeListener(java.lang.Object listener)
removeListener
in interface NavigatableRowIterator
listener
- the listener to be removed.public void addManagementListener(RowSetManagementListener listener)
RowSetIterator
RowSetManagementListener
events generated by this Row Set Iterator.
addManagementListener
in interface RowSetIterator
listener
- the subscriber to be added. It should implement
RowSetManagementListener
.public void removeManagementListener(RowSetManagementListener listener)
RowSetIterator
RowSetManagementListener
events generated by this row set iterator.
removeManagementListener
in interface RowSetIterator
listener
- the subscriber to be removed.public RowSet createRowSet(java.lang.String name)
createRowSet
in interface ViewObject
name
- the name of the new row set.
public RowSetIterator createRowSetIterator(java.lang.String name)
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);
createRowSetIterator
in interface RowSet
name
- the name of the new row set iterator.
public RowSetIterator[] getRowSetIterators()
RowSet
getRowSetIterators
in interface RowSet
public RowSetIterator findRowSetIterator(java.lang.String rsiName)
RowSet
findRowSetIterator
in interface RowSet
rsiName
- a row set iterator name. If null
, it returns the
the row set.
null
if the named row set iterator is not
not found.public int getRowCountInRange()
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(); } }
getRowCountInRange
in interface RowIterator
public Key buildKey(java.lang.Object[] values)
public Row[] findInCacheByKey(Key key, int maxNumOfRows)
public RowIterator findInCacheByAltKey(java.lang.String keyName, Key key, int maxNumOfRows)
public Row[] findByKey(Key key, int maxNumOfRows)
See
for details.
RowIterator.findByKey(oracle.jbo.Key, int)
findByKey
in interface RowIterator
key
- the key to match.maxNumOfRows
- the maximum size of the array to return,
or -1 to return all rows.
RowIterator.getRow(oracle.jbo.Key)
public void findAndSetCurrentRowByKey(Key key, int rangeIndex)
findAndSetCurrentRowByKey
in interface WSRowSetIteratorMarshaller
public boolean needsRefresh()
needsRefresh
in interface WSRowSetIteratorMarshaller
public Row[] findByKey(Key key, int maxNumOfRows, boolean skipWhere)
public RowIterator findByAltKey(java.lang.String keyName, Key key, int maxNumOfRows, boolean skipWhere)
RowIterator
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.
findByAltKey
in interface RowIterator
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.
public Key createKey(AttributeList nvp)
createKey
in interface RowIterator
public Row[] findByEntity(int eRowHandle, int maxNumOfRows)
RowIterator
eRowHandle
.
findByEntity
in interface RowIterator
eRowHandle
- the Entity row handle.maxNumOfRows
- the maximum size of the row array to return,
or -1 to return all rows.
public RowIterator findByViewCriteria(ViewCriteria criteria, int maxNumOfRows, int queryMode)
RowIterator
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
for different
contants that can be specified (they can be OR'ed together).
ViewObject
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.
on the finder View Object is invoked and the query executed.
ViewObject.applyViewCriteria(ViewCriteria)
Upon completion of this operation, the finder View Object is closed and removed.
findByViewCriteria
in interface RowIterator
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.
public RowIterator findByViewCriteriaWithBindVars(ViewCriteria criteria, int maxNumOfRows, int queryMode, Variable[] vars, java.lang.Object[] values)
public RowIterator findByViewCriteriaWithBindVars(ViewCriteria[] criterias, int maxNumOfRows, int queryMode, Variable[] vars, java.lang.Object[] values)
protected RowIterator findByViewCriteriaForViewRowSet(ViewRowSetImpl vrs, ViewCriteria criteria, int maxNumOfRows, int queryMode, Variable[] vars, java.lang.Object[] values)
protected void setQueryChanged(boolean isChanged)
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.
isChanged
- the new change flag.protected void setQueryAsChanged(boolean isChanged)
protected boolean isQueryChanged()
Indicates whether the query is marked changed or not.
protected void notifyRowInserted(ViewRowSetImpl vrs, Row viewRow, int rowIndex)
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 insertedprotected void notifyRowDeleted(ViewRowSetImpl vrs, Row viewRow, int rowIndex)
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.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, UpdateEvent updateEvent)
vrs
- ViewRowSetImpl instance to be notified about the attribute(s) updateviewRows
- 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.protected void notifyRowUpdated(ViewRowSetImpl vrs, Row[] viewRows, int[] attrIndices)
public RowSet[] getRowSets()
getRowSets
in interface ViewObject
public java.util.List<ViewRowSetImpl> getRowSetsInternal()
public ViewRowSetImpl getRowSetForSqlGen()
public java.util.HashMap getBindValsForSqlGen()
public RowSet findRowSet(java.lang.String rsName)
ViewObject
findRowSet
in interface ViewObject
rsName
- a row set name. If null
, it returns the
the view object.
null
if the named row set is not
not found.public ViewRowSetImpl getRowSetImpl(java.lang.String name, java.lang.Object accessKey)
protected ViewRowSetImpl createViewRowSet(java.lang.String rsName, boolean isDefaultRS, boolean isAccessorRS, boolean passivateRS)
protected void addRowSet(ViewRowSetImpl rs)
protected void removeRowSet(ViewRowSetImpl rs)
protected java.util.ArrayList getViewLinkDestinationAttributes()
protected boolean isForeignKey(ViewAttributeDefImpl attr)
attr
- a view attribute definition.
public long getSignature()
public java.lang.String getProxyClassName()
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".
getProxyClassName
in class ComponentObjectImpl
public java.lang.String getProxyInterfaceName()
protected void setProxyClassName(java.lang.String platform, java.lang.String proxyClassName)
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".
setProxyClassName
in class ComponentObjectImpl
platform
- name of the platform. Currently, can be either
VB (Visibroker) or 8i (Oracle8i).proxyClassName
- a name for the proxy class.public java.lang.String getRowProxyClassName()
Returns the name of this View Object's row proxy class.
public void remove()
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.
remove
in interface ComponentObject
remove
in class ComponentObjectImpl
InvalidOperException
- if the View Object is involved
in a View Link. Remove View Links before removing
the View Object.public void closeRowSet()
RowSet
closeRowSet
removes
this row set from the master row set iterator.
closeRowSet
in interface RowSet
public void closeRowSetIterator()
RowSetIterator
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.
closeRowSetIterator
in interface RowSetIterator
public byte getDefaultAccessMode()
public void setDefaultAccessMode(byte b)
public byte getAccessMode()
getAccessMode
in interface RowSet
RowSet.setAccessMode(byte)
public void setAccessMode(byte flag)
RowSet
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.
setAccessMode
in interface RowSet
flag
- One of the four enumerated values RowSet.SCROLLABLE
,
RowSet.FORWARD_ONLY
, RowSet.RANGE_PAGING
,
RowSet.RANGE_PAGING_AUTO_POST
.public int getDefaultRangePagingCacheFactor()
public void setDefaultRangePagingCacheFactor(int i)
public int getRangePagingCacheFactor()
getRangePagingCacheFactor
in interface RowSet
public void setRangePagingCacheFactor(int f)
setRangePagingCacheFactor
in interface RowSet
public void setForwardOnly(boolean isForwardOnly)
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.
setForwardOnly
in interface RowSet
isForwardOnly
- true if the row set should be
forward-only.public boolean isForwardOnly()
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.
isForwardOnly
in interface RowSet
RowSet.setForwardOnly(boolean)
public void setAssociationConsistent(boolean isConsistent)
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.
setAssociationConsistent
in interface RowSet
isConsistent
- true if association-consistency is to be enabled.protected void setDefaultAssocConsistent(boolean isEquiJoin)
protected boolean isDefaultAssocConsistent()
public boolean isFetchComplete()
RowSet
isFetchComplete
in interface RowSet
true
if the result set has been
fetched to the end.public final boolean isMaxFetchSizeExceeded()
RowSet
isMaxFetchSizeExceeded
in interface RowSet
true
if the result set has been
fetched to the maxFetchSize limit and there
are still more rows in the database.public boolean isAssociationConsistent()
isAssociationConsistent
in interface RowSet
setAssociationConsistent(boolean)
public java.lang.String getFullLoggingName()
protected java.sql.PreparedStatement getPreparedStatement(int noUserParams, boolean[] barr)
protected java.sql.CallableStatement getCallableStatement()
public void closeFreedStatements()
public void showCursorUsage(java.io.Writer out)
Debug routine that prints the cursor usage for this View Object.
out
- where to write the output.protected void beforeEntityRemove(Entity entity)
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.
entity
- entity about to be removed.protected void afterEntityRemove(Entity srow)
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.
srow
- entity that was removed.public void sourceChanged(EntityEvent event)
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.
sourceChanged
in interface EntityListener
event
- the Entity Object event.EntityListener
,
EntityEvent
public void afterCommit(TransactionEvent event)
Override this method to perfom any subclass-specific behavior.
afterCommit
in interface TransactionListener
event
- the transaction event.TransactionListener
public void clearCache()
clearCache
in interface ViewObject
public void afterRollback(TransactionEvent event)
afterRollback
in interface TransactionListener
event
- the transaction event.TransactionListener
public void afterRemove(TransactionEvent event)
afterRemove
in interface TransactionListener
event
- the transaction event.TransactionListener
public void beforeCommit(TransactionEvent e)
beforeCommit
in interface TransactionListener
e
- the transaction event.TransactionListener
public void beforeRollback(TransactionEvent e)
beforeRollback
in interface TransactionListener
e
- the transaction event.TransactionListener
public boolean isTransientTransactionListener()
Transient listeners are automatically removed at the end of a transaction commit or rollback cycle; permanent listeners remain across these cycles.
isTransientTransactionListener
in interface TransactionListener
true
if the listener is transient.public void postChanges(TransactionEvent e)
postChanges
in interface TransactionPostListener
e
- ignored.public boolean isPostedToDB()
isPostedToDB
in interface TransactionPostListener
public void setPostedToDB(boolean b)
setPostedToDB
in interface TransactionPostListener
public int getTransPostHandle()
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.
getTransPostHandle
in interface TransactionPostListener
public void setTransPostHandle(int hdl)
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.
setTransPostHandle
in interface TransactionPostListener
hdl
- the transaction post handle.public boolean isTransientTransactionPostListener()
Transient listeners are automatically removed at the end of a transaction post cycle; permanent listeners remain across post cycles. This property does not change.
isTransientTransactionPostListener
in interface TransactionPostListener
false
public void setListenToEntityEvents(boolean b)
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.
b
- the new listen-to-entity-events flag.protected EntityImpl findAssociatedEntity(QueryCollection qc, ViewRowImpl viewRow, EntityImpl[] entities, int srcEntityIndex, AssociationReference assocRef, java.lang.Object[] values)
This method may be overridden by a view object developer to provide custom logic for finding related entity row.
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.
null
. In the EmpDeptView example, the return value will be the related
Dept entity row.public java.lang.Object[] getForeignKeyValues(EntityImpl entity, oracle.jbo.server.EntityAssociationReference assocRef)
protected ViewObjectImpl findViewLinkAccessorVO(AssociationDefImpl assocDef, java.lang.String voName, ViewDefImpl vDef, ViewLinkDefImpl vlDef)
protected ViewObjectImpl createViewLinkAccessorVO(AssociationDefImpl assocDef, java.lang.String voName, ViewDefImpl vDef, ViewLinkDefImpl vlDef)
protected void validateRangeSizeForRangePaging(ViewRowSetImpl vrs, int rangeSize)
protected ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl assocDef, ViewObjectImpl accessorVO, Row masterRow, java.lang.Object[] values)
protected final VariableValueManager createVariableValueManager(VariableManagerOwnerBase owner, VariableManager[] varMgrParents)
createVariableValueManager
in class ComponentObjectImpl
protected VariableValueManager createVariableValueManagerForRS(RowSet owner, VariableManager[] varMgrParents)
protected ViewRowSetImpl createViewAccessorRS(ViewAccessorDef accessorDef, Row masterRow, java.lang.Object[] values, boolean addRSToMasterRow)
protected ViewRowSetImpl createViewLinkScanBaseRS(AssociationDefImpl assocDef, ViewObjectImpl accessorVO, Row masterRow)
protected java.util.ArrayList getMasterKeyValues(AssociationDefImpl assocDef)
assocDef
- the association definition between this master VO and
the scan (detail) VO
protected boolean isMasterKeyValues(java.lang.Object[] paramValues, int bindingStyle)
public void rangeRefreshed(RangeRefreshEvent event)
RowSetListener
rangeRefreshed
in interface RowSetListener
event
- a description of the new ranges.public void rangeScrolled(ScrollEvent event)
RowSetListener
rangeScrolled
in interface RowSetListener
event
- a description of the new range.public void rowInserted(InsertEvent event)
RowSetListener
rowInserted
in interface RowSetListener
event
- a description of the new Row object.public void rowDeleted(DeleteEvent event)
RowSetListener
rowDeleted
in interface RowSetListener
event
- a description of the deleted Row object.public void rowUpdated(UpdateEvent event)
RowSetListener
rowUpdated
in interface RowSetListener
event
- a description of the modified Row object.public void navigated(NavigationEvent event)
RowSetListener
navigated
in interface RowNavigationListener
navigated
in interface RowSetListener
event
- a description of the new and previous current rows.protected void createViewLinkAccessor(java.lang.String accrName, java.lang.String voName, ViewLink vl, ViewLinkDefImpl vlDef, ViewObject master, ViewObject detail, java.lang.Class javaType)
public AttributeDef findViewLinkAccessor(ViewLink vl)
findViewLinkAccessor
in interface ViewObject
vl
- the View Link whose accessor is sought.
null
.public ListBindingDef[] getListBindingDefsInternal()
public ViewRowSetImpl getByKeyFinderRS()
Returns the most recently opened rowset for servicing retrieveByKey.
protected ViewObjectImpl createFinderVO(java.lang.String suffix)
protected void bindFinderRS(java.lang.Object[] oParams, ViewRowSetImpl finderRS, boolean inclEffDateVals, boolean forceWhereVars)
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)
public static ViewRowSetIteratorImpl getImplObject(java.lang.Object rsi)
Given a RowSetIterator interface, this routine returns the inner ViewRowSetIteratorImpl object.
rsi
- the outer object that implements the RowSetIterator interface.
public final java.lang.String createXMLDefinition(int depthCount)
depthCount
- represents to what level in the View Object
the creation of the DTD definition
should recurse.public Node writeXML(long options, java.util.HashMap voAttrRules)
XMLInterface
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:
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.
writeXML
in interface XMLInterface
options
- a set of bit flags that will control the writeXMLvoAttrRules
- HashMap containing Definition names of ViewObjects and an
array of AttributeDef to render for a ViewObject of that definition type.public Node writeXML(int depthCount, long options, XSLStylesheet xslt)
writeXML
in interface XMLInterface
depthCount
- represents to what level data writing should recurse.options
- a set of bit flags that will control the writeXML behavior.xslt
- public Node writeXML(long options, java.util.HashMap voAttrMap, XSLStylesheet xslt)
writeXML
in interface XMLInterface
public final Node writeXML(int depthCount, long options)
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:
XML_ELEMENT_NAME
property which was set on the ViewObject definition at design time
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.
writeXML
in interface XMLInterface
depthCount
- represents to what level data writing should recurse.options
- a set of bit flags that will control the writeXML behavior.protected java.lang.String printXMLDefinition(oracle.jbo.server.RowSetImpl rs, java.util.Hashtable allDefs, java.io.PrintWriter pw, int depthCount)
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).
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.protected void appendXMLElementNodes(oracle.jbo.server.RowSetImpl rs, Document xmlDoc, Node voNode, int depthCount, long options, java.util.HashMap voAttrMap)
rs
- the rowSet to which you want to append row nodes.xmlDoc
- the DTDvoNode
- 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.protected void appendXMLElementNodes(oracle.jbo.server.RowSetImpl rs, Document xmlDoc, Node voNode, int depthCount, long options)
rs
- the rowSet to which you want to append row nodes.xmlDoc
- the DTDvoNode
- 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.public final void readXML(Element elem, int depthCount, XSLStylesheet xslt)
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.
readXML
in interface XMLInterface
elem
- the element to which data should be read.depthCount
- represents to what level reading of data should recurse.xslt
- public final void readXML(Element elem, int depthCount)
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).
readXML
in interface XMLInterface
elem
- the element from which data should be read.depthCount
- represents to what level the reading should recurse.public void readFromXml(XmlDocumentReader reader, Element el)
public java.lang.String getXMLElementTag()
public java.lang.String getXMLRowElementTag()
protected void updateRowSetFromXML(Element node, int depthCount, oracle.jbo.server.RowSetImpl rs)
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.
ReadXMLException
- when the read operation
fails while reading the rows for this rowset. This exception
may contain one exception per Row in this rowset.protected boolean checkPassivateViewAttributes()
protected final boolean isPassivatableTransientAttribute(ViewAttributeDefImpl voAttr)
protected final void setPassivatableTransientAttribute(ViewAttributeDefImpl voAttr, boolean flag)
protected void passivateDynamicAttributeDef(java.util.ArrayList dal, Document doc, Element parent)
dal
- A list of dynamic attribute definitions to passivatedoc
- XMLDocument to passivate data in.parent
- Element inside the document to passivate dynamic attributes in.protected void passivateState(Document doc, Element parent)
passivateState(ViewRowImpl, Document, Element)
is
that this method may be used to store custom data that does not depend
upon the VO Iterator or RowSet state which may include:
By default the ViewObject does not store anything in this method. On
activation, the ViewObject calls activateState(Element)
with
the parent element for the reverse operation.
doc
- the XML document where the custom data will be stored.parent
- the parent element under which the custom data will be
stored.protected void passivateState(ViewRowImpl currentRow, Document doc, Element parent)
This method lets customized View Objects determine how they want to store private data for:
The only requirement is that this data should be stored under a child node under the parent element. Note that the data cannot be stored under the first child, because that is where default passivation routines always store the key.
The default implementation of this method stores transient row data and new row tracker data in the parent element. The default implementation should not be overriden.
On activation, the View Object calls activateState(Element)
to notify
the activation of ViewObject instance state and activateState(ViewRowImpl, Element)
with the
currentRow, and parent element to notify the activation of iterator state.
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.protected void passivateState(ViewRowSetImpl vrs, ViewRowImpl currentRow, Document doc, Element parent)
protected void passivateNewRowTracker(QueryCollection qc, RowFilterKey rf, Document doc, Element parent)
protected void passivateTransients(ViewRowImpl currentRow, AttributeDefImpl[] attrs, Document doc, Element parent)
protected void passivateTransients(ViewRowSetImpl vrs, ViewRowImpl currentRow, AttributeDefImpl[] attrs, Document doc, Element parent)
protected void activateNewRowTracker(Element parent)
protected void activateNewRowTracker(ViewRowSetImpl vrs, Element parent)
protected ViewRowImpl handleActivatedRowNotFound(Key k)
Typically Applications will throw a RowNotFoundException for these cases based on their locking modes. By default this method simply prints a diagnostic warning.
k
- Key object for the row that was not found during activation.
protected void activateTransientAttribute(ViewRowImpl row, Node transRow, AttributeDefImpl ad)
protected void activateTransients(AttributeDefImpl[] attrs, Element parent)
protected void activateTransients(ViewRowSetImpl vrs, AttributeDefImpl[] attrs, Element parent)
protected void activateState(Element parent)
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.
parent
- element which could be null if nothing was passivated in it in passivateStateprotected void activateState(ViewRowImpl currentRow, Element parent)
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.protected void activateDynamicAttributeDefs(Node dyns)
protected void activateState(ViewRowSetImpl vrs, ViewRowImpl currentRow, Element parent)
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.public void readRowXML(Element rowElt, int depthCount)
ViewObject
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.
readRowXML
in interface ViewObject
public void readRowXML(Element elem, int depthCount, XSLStylesheet xslt)
readRowXML
in interface ViewObject
public void setQueryOptimizerHint(java.lang.String hintText)
setQueryOptimizerHint
in interface ViewObject
public java.lang.String getQueryOptimizerHint()
getQueryOptimizerHint
in interface ViewObject
public void dumpQCs()
Debugging aid to dump info for QCs.
public Row findRowInQCs(java.lang.Object[] rowFilterValues, Key key, java.lang.Object rowHandle)
public void activateIteratorState(Element node, boolean clearIteratorState)
Used by the framework to force an iterator activation. Applications
should extend activateIteratorState(Element, boolean)
.
protected ViewRowImpl activateCurrentRow(ViewRowSetIteratorImpl vrsi, ViewRowSetImpl vrs, Key key)
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.
protected void prepareForActivation(Element amNode)
amNode
- Element node under which this VO's data is being passivated.protected void prepareForPassivation(Document out, Element parent)
out
- Document in which to create xml nodes.parent
- Element node under which this VO's data is being passivated.protected void resetSession()
ApplicationModuleImpl.resetState(boolean)
public void setPassivationEnabled(boolean enabled)
public boolean isPassivationEnabled()
setPassivationEnabled(boolean)
public Row[] getFilteredRows(RowQualifier qualifier)
public Row[] getFilteredRowsInRange(RowQualifier qualifier)
public Row[] getFilteredRows(java.lang.String attrName, java.lang.Object attrValue)
RowSetIterator
attrValue
.
Note that this method does not affect the current RowSetIterator
.
getFilteredRows
in interface RowSetIterator
attrName
- name of the attribute to be used for filtering.attrValue
- attribute value for filtering.
public Row[] getFilteredRowsInRange(java.lang.String attrName, java.lang.Object attrValue)
RowSetIterator
attrValue
.
This method uses getAllRowsInRange()
to retrieve
all rows and then match the rows.
getFilteredRowsInRange
in interface RowSetIterator
attrName
- name of the attribute to be used for filtering.attrValue
- attribute value for filtering.
public StructureDef getSubclassDefFromStructureDef(StructureDef viewDef)
Called by ViewCriteriaRow to manage subclasses for polymorphic VOs.
public StructureDef getSubclassDef(ViewDefImpl viewDef)
protected void bindParametersForCollection(QueryCollection qc, java.lang.Object[] params, java.sql.PreparedStatement stmt) throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object getRowMatchBindValue(Row row, java.lang.String varName)
getRowMatchBindValue
in interface RowMatchBindValueSupplier
public RowSet deepCopy(java.util.HashMap voAttrMap, long options)
RowSet
.
deepCopy
in interface RowSet
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
.
RowSet
RowSet.deepCopy(java.util.HashMap, long)
public void resetExecuted()
RowSet
.
resetExecuted
in interface RowSet
RowSet.resetExecuted()
protected int buildEffectiveDateFromClauseFragment(java.lang.StringBuffer fromClause, int noUserParams)
fromClause
- The original from clausenoUserParams
- The parameter counter that is used up so far for generating
the oracle style bind parameter
protected int buildEffectiveDateWhereClauseFragment(java.lang.StringBuffer effDtClause, int noUserParams)
:SysEffectiveDate between effectiveStartDate and effectiveEndDate
effDtClause
- The buffer that would contain the generated clausenoUserParams
- The parameter counter that is used up so far for generating
the oracle style bind parameter
public SortCriteria[] getDBSortCriteria()
getDBSortCriteria
in interface ViewObject
ViewObject.setDBSortCriteria(SortCriteria[])
.public void setDBSortCriteria(SortCriteria[] sortCriteria)
ViewObject
setDBSortCriteria
in interface ViewObject
sortCriteria
- an array of database sort criteria with an element
for each attribute to sort withpublic boolean isRuntimeSQLGeneration()
isRuntimeSQLGeneration
in interface ViewCriteriaManagerOwner
public boolean isRuntimeSelectFromGeneration()
public boolean isSelectAllAttributes()
public void preFetchRowsByKeys(AttributeDef[] keyAttrs, Key[] keys)
public void preFetchRowsByKeys(AttributeDef[] keyAttrs, Key[] keys, Row parentRow)
public boolean isAutoRefreshEnabled()
protected ADFDatabaseChangeListener registerDatabaseChangeListener(QueryCollection qc, java.sql.Connection conn, java.sql.Statement stmt)
qc
- The Query Collection instanceconn
- Reference to a connection handlestmt
- The Statement object instantiated by the qc
that has the SQL Statement
and bind parameters for the database to identify a result set.
protected void onDatabaseChangeNotification(QueryCollection qc, java.util.EventObject evt)
qc
has changed.
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
.protected void processDatabaseChangeNotification(QueryCollection qc)
qc
- The Query Collection that was notified by the Database.protected void substituteAttribute(ViewAttributeDefImpl existingDef, ViewAttributeDefImpl replacement)
Substitues a existing view attribute definition with a different one. The replacement must have same name and index.
public boolean isEffectiveDated()
true
if 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
true
if the view object instance is effective dated,
false
otherwise.protected long getRowLimit()
protected java.util.List _internal_dbg_debug_data()
public java.util.Set<java.lang.String> findPrimaryKeyColumns(java.lang.String tableName)
protected double getQueryCollectionWeight(QueryCollection qc)
qc
- the query collection to evaluate
protected void initSharedQCPoolProperties(QCPoolProperties qcProp)
qcProp
- class used to set QC pool properties
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 2 (11.1.2.0.0) E17483-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |