|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jbo.common.PropertiesHelper oracle.jbo.client.remote.ViewUsageImpl
Field Summary | |
protected ApplicationModuleImpl |
mAM
|
protected ViewCriteria |
mCriteria
|
protected boolean |
mCriteriaGotten
|
protected RowSet |
mDefaultRowSet
|
protected java.lang.String |
mDefFullName
|
protected java.lang.String |
mDefName
|
protected java.lang.String |
mFullName
|
protected int |
mId
|
protected java.lang.String |
mInterfaceName
|
protected boolean |
mIsInternal
|
protected boolean |
mIsReadOnly
|
protected java.lang.String |
mName
|
protected java.lang.String |
mRowProxyClassName
|
protected com.sun.java.util.collections.ArrayList |
mRowSets
|
protected StructureDefImpl |
mStruct
|
protected com.sun.java.util.collections.ArrayList |
mViewLinks
|
Fields inherited from class oracle.jbo.common.PropertiesHelper |
mProperties |
Fields inherited from interface oracle.jbo.RowSet |
FORWARD_ONLY, RANGE_PAGING, RANGE_PAGING_AUTO_POST, SCROLLABLE |
Fields inherited from interface oracle.jbo.RowIterator |
ITER_MODE_LAST_PAGE_FULL, ITER_MODE_LAST_PAGE_PARTIAL, SLOT_BEFORE_FIRST, SLOT_BEYOND_LAST, SLOT_DELETED, SLOT_VALID |
Fields inherited from interface oracle.jbo.XMLInterface |
XML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT, XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE |
Constructor Summary | |
protected |
ViewUsageImpl()
|
Method Summary | |
AttributeDef |
addDynamicAttribute(java.lang.String attrName)
Adds a dynamic attribute (an AttributeDefImpl) to this View Object's row set. |
void |
addInternalListener(java.lang.Object target)
|
void |
addListener(java.lang.Object target)
Adds a subscriber (listener) to be notified of RowSetListener
events generated by this row set iterator. |
void |
addManagementListener(RowSetManagementListener target)
Adds a subscriber (listener) to be notified of RowSetManagementListener
events generated by this Row Set Iterator. |
protected void |
addViewLink(ViewLink viewLink)
|
AttributeDef |
addViewLinkAccessor(java.lang.String accrName)
|
void |
applyViewCriteria(ViewCriteria criteria)
Sets the view criteria. |
void |
clearCache()
Clears the View Object cache. |
void |
closeRowSet()
Closes the Row Set. |
void |
closeRowSetIterator()
Closes this row set iterator. |
Row |
createAndInitRow(AttributeList nvp)
Creates and initializes a new Row object, but does not insert it into the Row Set. |
RowSet |
createDetailRowSet(java.lang.String voName,
java.lang.String linkDefName)
Create a row set for the view link. |
Key |
createKey(AttributeList nvp)
Given a set of attribute values (name-value pairs), creates a key object for this ViewObject. |
Row |
createRow()
Creates a new Row object, but does not insert it into the Row Set. |
RowSet |
createRowSet(java.lang.String name)
Creates and returns a new (secondary) Row Ret for this View Object. |
RowSetIterator |
createRowSetIterator(java.lang.String name)
Creates an iterator for the Row Set. |
ViewCriteria |
createViewCriteria()
View Criteria factory |
java.util.Enumeration |
enumerateRowsInRange()
Gets an Enumeration of all rows in the Row Set. |
void |
executeQuery()
Executes the View Object's query. |
protected void |
finalize()
void addRowCount(Object rowHandle) { Integer entry = (Integer) mRowCount.get(rowHandle); if (entry == null) { mRowCount.put(rowHandle, new Integer(1)); } else { mRowCount.put(rowHandle, new Integer(entry.intValue() + 1)); } } boolean releaseRowCount(Object rowHandle) { Integer entry = (Integer) mRowCount.get(rowHandle); int useCount = entry.intValue(); Diagnostic.ASSERT(entry != null, "Cannot find row use entry for handle = " + ((Integer) rowHandle).intValue()); if (useCount == 1) { mRowCount.remove(rowHandle); return true; } else { mRowCount.put(rowHandle, new Integer(useCount - 1)); return false; } } |
void |
findAndSetCurrentRowByKey(Key k,
int rangeIndex)
|
AttributeDef |
findAttributeDef(java.lang.String name)
Gets an attribute definition, given its name. |
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. |
RowSet |
findRowSet(java.lang.String name)
Gets the named Row Set that was created at runtime for this View Object. |
RowSetIterator |
findRowSetIterator(java.lang.String name)
Gets the named Row Set Iterator that was created at runtime for this Row Set. |
AttributeDef |
findViewLinkAccessor(ViewLink vl)
Finds the view link accessor attribute. |
Row |
first()
Gets the first row in the iterator. |
byte |
getAccessMode()
|
int |
getActivationMode()
|
Row[] |
getAllRowsInRange()
Extracts the rows in the range. |
ApplicationModule |
getApplicationModule()
Gets the Row Set's Application Module that contains this Row Set. |
protected ApplicationModuleImpl |
getApplicationModuleProxy()
|
AttributeDef[] |
getAttrDefsForEntityAttr(java.lang.String eoName,
java.lang.String eoAttrName)
This method performs the same operation as getAttrIndicesForEntityAttr , except that it
return an array of attribute definitions, not just indices. |
int |
getAttributeCount()
Returns the number of defined attributes. |
AttributeDef |
getAttributeDef(int index)
Gets an attribute definition, given its index. |
AttributeDef[] |
getAttributeDefs()
Gets the defined attributes. |
int |
getAttributeIndexOf(java.lang.String name)
Finds the index (0-based) of the named attribute. |
int[] |
getAttrIndicesForEntityAttr(java.lang.String eoName,
java.lang.String eoAttrName)
Returns an array of indices of view attributes that are mapped to the entity attribute identified by the entity name (the eoName parameter) and the entity attribute name
(the eoAttrName ). |
SvcMsgIteratorState |
getCliIteratorState()
|
Row |
getCurrentRow()
Accesses the current row. |
int |
getCurrentRowIndex()
Gets the absolute index (not range index) of the current row. |
int |
getCurrentRowSlot()
Gets the slot status of the current row. |
java.lang.String |
getDefFullName()
Returns the fully qualified name of the structure's base definition. |
java.lang.String |
getDefName()
Returns the structure's base definition name (short form). |
RowSet[] |
getDetailRowSets()
Get all detail Row Sets for this View Object. |
int |
getDynamicAttributeCount()
|
int |
getDynamicAttributeOffset()
|
int |
getEstimatedRangePageCount()
Returns getEstimatedRowCount()/rangePageSize, if rangeSize > 0. |
long |
getEstimatedRowCount()
Counts the number of rows in the collection defined by the View Object's query. |
int |
getFetchedRowCount()
Counts the number of rows fetched from database into the Row Set collection up to this point. |
Row[] |
getFilteredRows(java.lang.String attrName,
java.lang.Object attrValue)
Returns all rows in this collection whose attribute value matches the value being passed in attrValue . |
Row[] |
getFilteredRowsInRange(java.lang.String attrName,
java.lang.Object attrValue)
Returns all rows in this range whose attribute value matches the value being passed in attrValue . |
java.lang.String |
getFullName()
Returns the structure's fully qualified name. |
static oracle.jbo.client.remote.RowSetIteratorImpl |
getImplObject(java.lang.Object rsi)
|
int |
getIterMode()
Gets the current iteration mode. |
AttributeDef[] |
getKeyAttributeDefs()
Returns the attribute definitions that make up the constituents of the Key object for Rows returned from this View Object. |
RowSetIterator[] |
getMasterRowSetIterators()
Return all controlling masters of this Row Set. |
int |
getMaxFetchSize()
Maximum number of rows to fetch for this View Object. |
java.lang.String |
getName()
Returns the structure's name (short form). |
Row[] |
getNextRangeSet()
Gets the next set of rows in the range. |
protected ObjectMarshaller |
getObjectMarshaller()
|
java.lang.String |
getOrderByClause()
Returns the query's ORDER BY clause. |
java.lang.Object |
getParent()
|
protected byte[] |
getPiggyback()
|
Row[] |
getPreviousRangeSet()
Gets the previous set of rows in the range. |
java.util.Hashtable |
getProperties()
Gets the table of properties. |
java.lang.String |
getQuery()
Returns the query statement. |
java.lang.String |
getQueryOptimizerHint()
Returns Query Optimizer Hint set for this ViewObject or for its definition object. |
int |
getRangeIndexOf(Row row)
Get the index of the given row relative to the beginning of the range. |
int |
getRangeSize()
Gets the size of the Row Set Iterator range. |
int |
getRangeStart()
Gets the absolute row index of the first row in the Row Set Iterator range. |
int |
getRemoteId()
|
byte |
getROTEntryType()
|
Row |
getRow(Key key)
Locates and returns a row by its unique key. |
Row |
getRowAtRangeIndex(int index)
Accesses a row through its range index. |
int |
getRowCount()
Counts the total number of rows in the Row Set. |
int |
getRowCountInRange()
Gets the size of the Row Set Iterator range. |
java.lang.Object[] |
getRowFilterValues()
|
RowSet |
getRowSet()
Gets the Row Set that this Iterator belongs to. |
RowSetIterator |
getRowSetIterator()
|
RowSetIterator[] |
getRowSetIterators()
Gets all Row Set Iterators that belong to this Row Set. |
RowSet[] |
getRowSets()
Get all Row Sets that belong to this View Object. |
protected ServiceMessage |
getServiceMessage()
|
StructureDef |
getStructDef()
|
java.lang.Object |
getSyncLock()
Gets the locking object for this Row Set Iterator. |
ViewCriteria |
getViewCriteria()
Gets the view criteria. |
java.lang.String[] |
getViewLinkNames()
Constructs an array of names of View Links that involve this View Object. |
protected ViewLink[] |
getViewLinks()
|
ViewObject |
getViewObject()
Gets the View Object that contains this Row Set. |
java.lang.String |
getWhereClause()
Gets the query's WHERE clause. |
java.lang.Object[] |
getWhereClauseParams()
Gets the bind variable values to be used with the View Object's where-clause. |
boolean |
hasNext()
Tests for the existence of a row after the current row. |
boolean |
hasPrevious()
Tests for the existence of a row before the current row. |
protected void |
init(ApplicationModuleImpl appModule,
int voId,
java.lang.String name,
java.lang.String fullName,
java.lang.String defName,
java.lang.String defFullName,
boolean isRO)
|
void |
insertRow(Row row)
Inserts a row to the Row Set, before the current row. |
void |
insertRowAtRangeIndex(int index,
Row row)
Inserts a row to the Row Set at the given range index. |
boolean |
isAssociationConsistent()
Tests if association-consistent mode is on. |
boolean |
isExecuted()
Returns true if the current ViewObject's query has been executed for this Row Set. |
boolean |
isFetchComplete()
Tests if the query result set has been fetched to the end. |
boolean |
isForwardOnly()
Tests if the Row Set is constrained to sequential access. |
boolean |
isInternal()
Returns whether this View Object was created internally by BC4J or by an explicit user request. |
boolean |
isMaxFetchSizeExceeded()
Tests if the query result has been fetched to the end and the end was reached due to hitting the maxFetchSize limit |
boolean |
isNameGenerated()
Tests if the Iterator's name was generated by the system. |
boolean |
isRangeAtBottom()
Tests if the Row Set Iterator range is at the end of the result set. |
boolean |
isRangeAtTop()
Tests if the Row Set Iterator range is at the beginning of the result set. |
boolean |
isReadOnly()
Tests if the View Object is read-only. |
boolean |
isRowValidation()
Gets the validation flag on this iterator. |
Row |
last()
Gets the last row in the iterator. |
AttributeDef |
lookupAttributeDef(java.lang.String name)
Gets an attribute definition, given its name. |
void |
navigated(NavigationEvent event)
Invoked when the current-row designation changes. |
Row |
next()
Gets the next row in the iterator. |
void |
prepareForBatchMode(SvcMsgIteratorState iteratorState,
boolean setCurrentRow)
|
Row |
previous()
Gets the previous row in the iterator. |
protected void |
processPiggyback(byte[] pb)
|
protected com.sun.java.util.collections.ArrayList |
processServiceMessage(ServiceMessage svcMsg)
|
void |
rangeRefreshed(RangeRefreshEvent event)
Invoked when the range changes. |
void |
rangeScrolled(ScrollEvent event)
Invoked when the range is scrolled. |
void |
readRowXML(Element elem,
int depthCount)
Reads the data in XML form (in the format as generated by writeXML()) by finding a row that matches the key in the given XML and then reading in that row. |
void |
readRowXML(Element elem,
int depthCount,
XSLStylesheet xslt)
|
void |
readXML(Element elem,
int depthCount)
|
void |
readXML(Element elem,
int depthCount,
XSLStylesheet xslt)
|
java.lang.Object |
refreshProperty(java.lang.String hintName)
Retrieves the specified property, if it exists. |
void |
remove()
Deletes this component. |
void |
removeCurrentRow()
Removes the current Row object from the Row Set. |
Row |
removeCurrentRowAndRetain()
Removes the current Row object from the collection and retain it for insertion into another location. |
void |
removeCurrentRowFromCollection()
Removes the current Row object from the collection. |
void |
removeInternalListener(java.lang.Object target)
|
void |
removeListener(java.lang.Object target)
Removes a subscriber (listener) for RowSetListener
events generated by this row set iterator. |
void |
removeManagementListener(RowSetManagementListener target)
Removes a subscriber (listener) for RowSetManagementListener
events generated by this row set iterator. |
boolean |
removeMasterRowSetIterator(RowSetIterator masterRS)
Removes a master Row Set Iterator. |
protected void |
removeViewLink(ViewLinkImpl viewLink)
|
void |
reset()
Moves the currency to the slot before the first row. |
void |
rowDeleted(DeleteEvent event)
Invoked when a row has been deleted. |
void |
rowInserted(InsertEvent event)
Invoked when a row has been inserted. |
void |
rowUpdated(UpdateEvent event)
Invoked when an attribute of the row has been changed. |
int |
scrollRange(int amount)
Moves the Row Set Iterator range up or down a given number of rows. |
int |
scrollRangeTo(Row row,
int index)
Scrolls the range to place a given row at a given range index. |
int |
scrollToRangePage(int pageIndex)
Moves the row set range start to the given page index where every page consists of RangeSize number of rows. |
void |
setAccessMode(byte mode)
Constrains the row access based on the following settings: |
void |
setAssociationConsistent(boolean isConsistent)
Sets the association-consistent flag for this Row Set. |
boolean |
setCurrentRow(Row row)
Designates a given row as the current row. |
boolean |
setCurrentRowAtRangeIndex(int index)
Designates a given index as the current row. |
void |
setForwardOnly(boolean isForwardOnly)
Constrains the Row Set to sequential access. |
void |
setIterMode(int mode)
Sets the iteration mode for this Row Iterator. |
boolean |
setMasterRowSetIterator(RowSetIterator masterRS)
Sets the master iterator. |
void |
setMaxFetchSize(int max)
Maximum number of rows to fetch for this View Object. |
void |
setOrderByClause(java.lang.String expr)
Sets the ORDER BY clause of the View Object's query statement. |
void |
setProperty(java.lang.String hintName,
java.lang.Object hintValue)
|
void |
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 \/*+ |
int |
setRangeSize(int size)
Modifies the size of the Row Set Iterator range. |
int |
setRangeStart(int start)
Moves the Row Set Iterator range. |
void |
setRowFilterValues(java.lang.Object[] rowFilterValues)
|
void |
setRowValidation(boolean flag)
Sets the validation flag on this iterator. |
void |
setWhereClause(java.lang.String cond)
Sets a WHERE clause bind value of the View Object's query statement. |
void |
setWhereClauseParam(int index,
java.lang.Object value)
Specifies a single bind variable value to use with the View Object's where-clause. |
void |
setWhereClauseParams(java.lang.Object[] values)
Specifies the bind variable values to use with the View Object's where-clause. |
Node |
writeXML(int depthCount,
long options)
Renders data in a canonical XML-format. |
Node |
writeXML(int depthCount,
long options,
XSLStylesheet xslt)
|
Node |
writeXML(long options,
com.sun.java.util.collections.HashMap voAttrMap)
Renders data in a canonical XML-format. |
Node |
writeXML(long options,
com.sun.java.util.collections.HashMap voAttrMap,
XSLStylesheet xslt)
|
Methods inherited from class oracle.jbo.common.PropertiesHelper |
getProperty |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.jbo.Properties |
getProperty |
Field Detail |
protected java.lang.String mName
protected java.lang.String mFullName
protected java.lang.String mDefName
protected java.lang.String mDefFullName
protected int mId
protected ApplicationModuleImpl mAM
protected StructureDefImpl mStruct
protected RowSet mDefaultRowSet
protected com.sun.java.util.collections.ArrayList mRowSets
protected boolean mIsInternal
protected boolean mIsReadOnly
protected com.sun.java.util.collections.ArrayList mViewLinks
protected ViewCriteria mCriteria
protected boolean mCriteriaGotten
protected java.lang.String mRowProxyClassName
protected java.lang.String mInterfaceName
Constructor Detail |
protected ViewUsageImpl()
Method Detail |
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
protected void init(ApplicationModuleImpl appModule, int voId, java.lang.String name, java.lang.String fullName, java.lang.String defName, java.lang.String defFullName, boolean isRO)
public java.lang.String getName()
StructureDef
getName
in interface ClientComponentObject
public java.lang.String getFullName()
StructureDef
getFullName
in interface ClientComponentObject
public java.lang.String getDefName()
StructureDef
getName()
returns the VO's
instance name and getDefName()
returns the
View definition's name.
getDefName
in interface StructureDef
public java.lang.String getDefFullName()
StructureDef
getFullName()
returns the VO's
full instance name and getDefFullName()
returns the
View definition's full name.
getDefFullName
in interface StructureDef
public int getActivationMode()
getActivationMode
in interface WSViewObjectMarshaller
public void remove()
ComponentObject
remove
in interface ComponentObject
public int getRemoteId()
getRemoteId
in interface ClientComponentObject
public byte getROTEntryType()
getROTEntryType
in interface ClientComponentObject
public StructureDef getStructDef()
public AttributeDef[] getAttributeDefs()
StructureDef
getAttributeDefs
in interface StructureDef
public int getAttributeCount()
StructureDef
getAttributeCount
in interface StructureDef
public AttributeDef findAttributeDef(java.lang.String name)
StructureDef
findAttributeDef
in interface StructureDef
name
- the name of an AttributeDef
.
public AttributeDef lookupAttributeDef(java.lang.String name)
StructureDef
lookupAttributeDef
in interface StructureDef
name
- the name of an AttributeDef
.
public AttributeDef getAttributeDef(int index)
StructureDef
getAttributeDef
in interface StructureDef
index
- the index of an AttributeDef
, where the leftmost
attribute has index zero.
public int getAttributeIndexOf(java.lang.String name)
StructureDef
getAttributeIndexOf
in interface StructureDef
name
- the attribute's name.
0
to getAttributeCount() - 1
.
If the named attribute is not found, it returns -1.public AttributeDef[] getKeyAttributeDefs()
ViewObject
This method is used to pass AttributeDef[] to the
Key.Key(String, AttributeDef[])
constructor to parse the constituent-bytes and convert them into
value-objects that make up the Key.
Use this method to find out how the key is composed for the View row. The View Object's key is a composite key, consisting of view attributes mapped to the primary keys of its Entity Objects.
getKeyAttributeDefs
in interface ViewObject
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 void setWhereClause(java.lang.String cond)
ViewObject
Bind variables can be specified using '?' as a place-holder for the value.
The new WHERE clause does not take effect until
ViewObjectImpl.executeQuery()
is called. For an example usage of this method,
see ViewObjectImpl.setWhereClauseParam(int, Object)
.
Note that calling
setWhereClause() does not clear the previous settings of WHERE clause
parameters. To reset WHERE clause parameters in the middle tier, call
ViewObjectImpl.setWhereClauseParams(Object[])
explicitly with a null value. For example:
vo.setWhereClauseParams(null);This method should not be overridden.
setWhereClause
in interface ViewObject
cond
- a WHERE clause, but excluding the 'WHERE' keyword.public java.lang.String getWhereClause()
ViewObject
This WHERE clause is obtained from the
View Object instance. In the middle tier, to get the WHERE clauses built from the View Object
instance, the View definition, and the detail View Objects, use
ViewObjectImpl.buildWhereClause(java.lang.StringBuffer, int)
getWhereClause
in interface ViewObject
public void setWhereClauseParams(java.lang.Object[] values)
RowSet
Setting the where-clause bind values through this method
does not automatically execute the query. You must call
to apply the new bind
values.
RowSet.executeQuery()
setWhereClauseParams
in interface RowSet
values
- an array of bind values. If the View Object
is using the JDBC style bindings ("?"
for bind
variable), values[n]
is bound to
the bind variable that appears in the n-th
order (0 based indexing). If the View Object
is using the Oracle style bindings (":1", ":2",
etc.
for bind variable), values[n]
is
bound to the bind variable :(n+1)
, i.e.,
values[0]
is bound to :1
,
values[1]
is bound to :2
, etc.public void setWhereClauseParam(int index, java.lang.Object value)
RowSet
Setting the where-clause bind values through this method
does not automatically execute the query. You must call
to apply the new bind
values.
RowSet.executeQuery()
setWhereClauseParam
in interface RowSet
index
- the index identifying the bind variable. If the View Object
is using the JDBC style bindings ("?"
for bind
variable), value
is bound to
the bind variable that appears in the index-th
order (0 based indexing). If the View Object
is using the Oracle style bindings (":1", ":2",
etc.
for bind variable), value
is
bound to the bind variable :(index+1)
.
If index
is 0, value
is bound to :1
.
If index
is 1, value
is bound to :2
.value
- the bind variable value.public java.lang.Object[] getWhereClauseParams()
RowSet
getWhereClauseParams
in interface RowSet
public void setOrderByClause(java.lang.String expr)
ViewObject
ViewObjectImpl.executeQuery()
is called.
This method should not be overridden.
setOrderByClause
in interface ViewObject
public java.lang.String getOrderByClause()
ViewObject
This method should not be overridden.
getOrderByClause
in interface ViewObject
public java.lang.String getQuery()
ViewObject
ViewObjectImpl.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.util.Hashtable getProperties()
Properties
getProperties
in interface Properties
getProperties
in class PropertiesHelper
public void setProperty(java.lang.String hintName, java.lang.Object hintValue)
setProperty
in class PropertiesHelper
public java.lang.Object refreshProperty(java.lang.String hintName)
Properties
getProperty
.
refreshProperty
in interface Properties
refreshProperty
in class PropertiesHelper
public boolean isExecuted()
RowSet
isExecuted
in interface RowSet
true
if query has been executed.public void executeQuery()
RowSet
executeQuery
in interface RowSet
public java.lang.String[] getViewLinkNames()
ViewObject
A View Link may use this View Object as either its source or destination. This method should not be overridden.
getViewLinkNames
in interface ViewObject
public void clearCache()
ViewObject
clearCache
in interface ViewObject
public RowSet getRowSet()
RowSetIterator
getRowSet
in interface RowSetIterator
public RowSetIterator getRowSetIterator()
public Row next()
RowIterator
next()
is called on an iterator whose Row Set has
not yet been #oracle.jbo.RowSet.executeQuery()
'ed, the
Row Set's query is executed. Thus, the user does not need to call
executeQuery()
himself before calling next()
.
We refer to this as implicit query execution or
implicit Row Set execution.
Before moving to the next row, next()
validates the current row
(if the iterator has a current row) through a call to
.
#oracle.jbo.Row.validate()
If the currency is on the last row of the range and next()
is
called, the range is scolled down by one row to bring the next row into
the visible range. In particular, if the range size is 1, next()
scrolls the range down by 1 row.
When this method is called, the current row of the iterator
may be outside the range. (Note that the current row does not
have to be within the range.) If so, next()
will
scroll the range, so that the row that will be the current row
at the conclusion of this method will be positioned in the middle
of the range.
If the iterator is just opened or reset (see
),
RowIterator.reset()
next()
will return the first row if one exists.
In this situation, next()
is functionally equivalent
to
.
RowIterator.first()
If the iterator is at the last row of the Row Set, next()
push the currency into the imaginary slot after the last row.
This will set the current slot status to SLOT_BEYOND_LAST
.
When the next row is required, a check is made to see if the row
has already been brought into the collection. If not, the row is fetched from
database. Note that the View Object's fetch mode affects how rows
are fetched from database into the collection. See
for details.
#oracle.jbo.server.ViewObjectImpl.getFetchMode()
If successful, this method designates the next row as the current row (the currency finally moves).
This method generates events to notify the changes to the iterator.
If scrolling occurs because of conditions described above, a
will be sent to
#oracle.jbo.ScrollEvent
.
To pick up such an event, the listener object must implement the
#oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent)
interface. Further, this listener
must be registered through a call to
#oracle.jbo.RowSetListener
(the listener object passed in as the parameter to
#oracle.jbo.NavigatableRowIterator.addListener(Object)
addListener
).
If the currency is changed, it generates a
and sends it to
#oracle.jbo.NavigationEvent
.
#oracle.jbo.RowSetListener.navigated(oracle.jbo.NavigationEvent)
next
in interface RowIterator
#oracle.jbo.Row
object, or null
if there is no next row.public Row previous()
RowIterator
previous()
is called on an iterator whose Row Set has
not yet been #oracle.jbo.RowSet.executeQuery()
'ed, the
Row Set's query is executed. Thus, the user does not need to call
executeQuery()
himself before calling previous()
.
We refer to this as implicit query execution or
implicit Row Set execution.
Before moving to the previous row, previous()
validates the current row
(if the iterator has a current row) through a call to
.
#oracle.jbo.Row.validate()
If the currency is on the first row of the range and previous()
is
called, the range is scolled up by one row to bring the previous row into
the visible range. In particular, if the range size is 1, previous()
scrolls the range up by 1 row.
When this method is called, the current row of the iterator
may be outside the range. (Note that the current row does not
have to be within the range.) If so, previous()
will
scroll the range, so that the row that will be the current row
at the conclusion of this method will be positioned in the middle
of the range.
If the iterator is just opened or reset (see
),
RowIterator.reset()
previous()
will null
as the currency is
already on the imaginary slot before the first row.
If the iterator is at the first row of the Row Set, previous()
push the currency into the imaginary slot before the first row.
This will set the current slot status to SLOT_BEFORE_FIRST
.
If successful, this method designates the previous row as the current row (the currency finally moves).
This method generates events to notify the changes to the iterator.
If scrolling occurs because of conditions described above, a
will be sent to
#oracle.jbo.ScrollEvent
.
To pick up such an event, the listener object must implement the
#oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent)
interface. Further, this listener
must be registered through a call to
#oracle.jbo.RowSetListener
(the listener object passed in as the parameter to
#oracle.jbo.NavigatableRowIterator.addListener(Object)
addListener
).
If the currency is changed, it generates a
and sends it to
#oracle.jbo.NavigationEvent
.
#oracle.jbo.RowSetListener.navigated(oracle.jbo.NavigationEvent)
previous
in interface RowIterator
#oracle.jbo.Row
object, or null
if there is no previous row.public Row first()
RowIterator
first()
is called on an iterator whose Row Set has
not yet been #oracle.jbo.RowSet.executeQuery()
'ed, the
Row Set's query is executed. Thus, the user does not need to call
executeQuery()
himself before calling first()
.
We refer to this as implicit query execution or
implicit Row Set execution.
This method checks to see if the currency is not on the first row.
If not, it resets the currency to the imaginary slot before the
first row and then calls
. Note that the act of
resetting the currency may cause the range to scroll upward.
RowIterator.next()
If the currency is on the slot before the first row, it
simply calls next()
. In this case, first()
is equivalent to next()
.
If the currency is already on the first row, nothing happens.
If first()
is called on an empty Row Set (a Row Set that
has no row), the currency is set to the slot after the last row, and
null
is returned.
This method generates events to notify the changes to the iterator,
e.g.,
and/or #oracle.jbo.ScrollEvent
.
See #oracle.jbo.NavigationEvent
for details.
RowIterator.next()
first
in interface RowIterator
#oracle.jbo.Row
object, or null
if there is no first row. In that case (null
return),
the current slot status will be RowIterator.SLOT_BEYOND_LAST
.public Row last()
RowIterator
last()
is called on an iterator whose Row Set has
not yet been #oracle.jbo.RowSet.executeQuery()
'ed, the
Row Set's query is executed. Thus, the user does not need to call
executeQuery()
himself before calling last()
.
We refer to this as implicit query execution or
implicit Row Set execution.
Before moving to the last row, last()
validates the current row
(if the iterator has a current row) through a call to
.
#oracle.jbo.Row.validate()
This method retrieves all rows from the Row Set and scrolls (if necessary)
to the last row. If some of these rows have not yet been fetched
from database, it fetches them. The View Object's fetch mode affects how rows
are fetched from database into the collection. See
for details.
#oracle.jbo.server.ViewObjectImpl.getFetchMode()
If successful, this method designates the last row as the current row.
If last()
is called on an empty Row Set, the currency moves
to the slot beyond the last row. The current slot status is set to
.
RowIterator.SLOT_BEYOND_LAST
The caller of this method should be aware that it may take a long time to complete as all rows from the Row Set are fetched.
The number of rows in the range at the completion of this method is affected by the "iteration mode". See Iteration Modes above for details.
This method generates events to notify the changes to the iterator.
If scrolling occurs because of conditions described above, a
will be sent to
#oracle.jbo.ScrollEvent
.
To pick up such an event, the listener object must implement the
#oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent)
interface. Further, this listener
must be registered through a call to
#oracle.jbo.RowSetListener
(the listener object passed in as the parameter to
#oracle.jbo.NavigatableRowIterator.addListener(Object)
addListener
).
If the currency is changed, it generates a
and sends it to
#oracle.jbo.NavigationEvent
.
#oracle.jbo.RowSetListener.navigated(oracle.jbo.NavigationEvent)
last
in interface RowIterator
#oracle.jbo.Row
object, or null
if there is no last row.public void reset()
RowIterator
After this method, the current slot status will be
.
A subsequent invocation of RowIterator.SLOT_BEFORE_FIRST
will cause the first
row to become the current row.
RowIterator.next()
It sends a
to
#oracle.jbo.ScrollEvent
if the currency was not on the first row or on the slot before the first row.
To pick up such an event, the listener object must implement the
#oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent)
interface. Further, this listener
must be registered through a call to
#oracle.jbo.RowSetListener
(the listener object passed in as the parameter to
#oracle.jbo.NavigatableRowIterator.addListener(Object)
addListener
).
reset
in interface RowIterator
public boolean hasNext()
RowIterator
hasNext
in interface RowIterator
true
if there is a next row.
Specifically, if the Row Set is empty or if the currency
is on the last row or the slot after the last row
(current slot status == RowIterator.SLOT_BEYOND_LAST
),
it returns false
. Otherwise, true
.public boolean hasPrevious()
RowIterator
If the Row Set is forward-only, it returns false
.
hasPrevious
in interface RowIterator
true
if there is a previous row.
Specifically, if the Row Set is empty or forward-only or
if the currency is on the first row or the slot before the first row
(current slot status == RowIterator.SLOT_BEFORE_FIRST
),
it returns false
. Otherwise, true
.public boolean isRangeAtBottom()
RowIterator
isRangeAtBottom
in interface RowIterator
true
if the last row of the range is
the last row of the result set.public boolean isRangeAtTop()
RowIterator
isRangeAtTop
in interface RowIterator
true
if the first row of the range is
the first row of the result set.public int getFetchedRowCount()
RowIterator
getFetchedRowCount
in interface RowIterator
public int getRowCount()
RowIterator
Note that this method retrieves all rows from the database then returns the number of rows in the Row Set collection.
getRowCount
in interface RowIterator
public long getEstimatedRowCount()
RowSet
This number may fluxuate when the View Object is syncronized with its Entity Object.
getEstimatedRowCount
in interface RowSet
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 setRangeSize(int size)
RowIterator
This method takes effect when the next set of data is fetched. For an example usage of setRangeSize, see setRangeStart.
setRangeSize
in interface RowIterator
size
- the new number of rows in the iterator range. Size of
0 is treated same as 1. Size < -1 is treated same as -1.
RowIterator.setRangeStart(int)
public int getRangeSize()
RowIterator
getRangeSize
in interface RowIterator
public int getRangeStart()
RowIterator
The absolute index is 0-based, and is the row's index relative to the entire result set.
getRangeStart
in interface RowIterator
public int setRangeStart(int start)
RowIterator
Note that the index is 0-based. When you call setRangeStart(1), the range start will be positioned at the second table row.
Another behavior of setRangeStart (and also setRangeSize) is that it tries to position the range, so as to fill up the range as much as possible. For example, assume you have View Object vo focused on a table with four rows (A, B, C, D), and you execute the following code:
vo.setRangeStart(4); vo.setRangeSize(3); Row[] rows = vo.getAllRowsInRange();
In this case, rows contains the last 3 rows (B, C, D). When you call setRangeStart(4), it will try to position you at row 4. Since the index is 0-based, it finds that there is no row. Since the default range size is 1, it will position you to the last row (row index 3).
Then, when you call getRangeSize(3), it tries to fill up the range from the bottom. This is why you get (B, C, D).
setRangeStart
in interface RowIterator
start
- the absolute index of the new first row in the Row Set Iterator range.public int scrollRange(int amount)
RowIterator
scrollRange
in interface RowIterator
amount
- the number of rows to scroll.
A negative value scrolls upward.
public int getEstimatedRangePageCount()
RowSetIterator
This number may fluxuate when the View Object is syncronized with its Entity Object.
getEstimatedRangePageCount
in interface RowSetIterator
public int scrollToRangePage(int pageIndex)
RowSetIterator
(rangeSize * (pageSize-1)) - getRangeStart();
scrollToRangePage
in interface RowSetIterator
pageIndex
- the page number to go to in the result set.
public int scrollRangeTo(Row row, int index)
RowIterator
scrollRangeTo
in interface RowIterator
row
- the row.index
- the range index at which the row is to be found.
public Row getRow(Key key)
RowIterator
If the key being passed in has the row handle, it uses the row handle
to locate the row. This is a quick operation. (A key returned from
a call to
contains the
row handle.)
Row.getKey()
If the key does not have a row handle, or if the handle look up did not find the row in the View row cache, it performs a linear search through the Row Set collection looking for a match. Hence, this method could take quite a long time to complete.
This method is similar to
in that both methods return Row(s) that match the given key. However,
the user should understand the differences. First, findByKey() performs
random search. getKey() only performs random search if the key
has the row handle portion and if the row with that handle is currently
in the Row Set collection. Otherwise, getKey() does a linear search.
Hence, findByKey() is generally faster.
RowIterator.findByKey(Key, int)
However, findByKey() may find the matching Row(s) out of sequence. When a row is not found in the View row cache, findByKey() issues a database query. Matching rows are retrieved and appended to the Row Set collection. For example, suppose the Row Set collection has 200 rows that qualify in the database. Suppose the user retrieved only 10 rows (190 not yet retrieved). Suppose, at this time, the user issues findByKey() that locates the 200-th row (the last row in database result set). That row is appended to the Row Set collection at the 11-th spot. Thus, when you use findByKey(), you may see rows out of sequence. In contrast, getRow() always retrieves rows in sequence.
If the Row Set collection is of any non-trivial size (say over 50), we would recommend findByKey().
findByKey() allows for partial key (only for View Objects that have multiple Entity bases). When a partial key is specified, multiple rows may return. getKey() returns one and only one row (exact match).
getRow
in interface RowIterator
key
- the key.
public Row getRowAtRangeIndex(int index)
RowIterator
getRowAtRangeIndex
in interface RowIterator
index
- an index in the range: 0 to
getRangeSize() - 1
.
null
if the index is out of range.public Row getCurrentRow()
RowIterator
getCurrentRow
in interface RowIterator
public int getCurrentRowIndex()
RowIterator
getCurrentRowIndex
in interface RowIterator
public int getCurrentRowSlot()
RowIterator
getCurrentRowSlot
in interface RowIterator
SLOT_
.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)
RowIterator
setCurrentRow
in interface RowIterator
row
- the new current row.
true
if the operation succeeded.public boolean setCurrentRowAtRangeIndex(int index)
RowIterator
setCurrentRowAtRangeIndex
in interface RowIterator
index
- the index of the new current row.
true
if the operation succeeded.public Row createAndInitRow(AttributeList nvp)
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
nvp
- a list of name-value pairs.
public Row createRow()
RowIterator
createRow
in interface RowIterator
public void insertRow(Row row)
RowIterator
insertRow
in interface RowIterator
row
- the Row object to be added.public void insertRowAtRangeIndex(int index, Row row)
RowIterator
index
is
relative to the range, i.e., index
of 0 would mean to insert
before the first row of the range. Allowed values for index
is 0 to range size. If index
equals range size, the row
is inserted right after the last row in the range. This method call does not
alter the current position of the iterator, nor does it affect the range
position.
insertRowAtRangeIndex
in interface RowIterator
index
- the point where row
is to be added.row
- the Row object to be added.public void removeCurrentRow()
RowIterator
removeCurrentRow
in interface RowIterator
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 #removeAndRetain()
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)
RowIterator
getRangeIndexOf
in interface RowIterator
row
- a Row object.
or -1
if the row is not in range.
row
,public java.util.Enumeration enumerateRowsInRange()
RowIterator
Enumeration
of all rows in the Row Set.
enumerateRowsInRange
in interface RowIterator
Enumeration
interface.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 Row[] getAllRowsInRange()
RowIterator
getAllRowsInRange
in interface RowIterator
setViewSize()
.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 #oracle.jbo.ScrollEvent
.
To pick up such an event, the listener object must implement the
#oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent)
interface. Further, this listener
must be registered through a call to
#oracle.jbo.RowSetListener
(the listener object passed in as the parameter to
#oracle.jbo.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
#oracle.jbo.NavigationEvent
.
#oracle.jbo.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 #oracle.jbo.ScrollEvent
.
To pick up such an event, the listener object must implement the
#oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent)
interface. Further, this listener
must be registered through a call to
#oracle.jbo.RowSetListener
(the listener object passed in as the parameter to
#oracle.jbo.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
#oracle.jbo.NavigationEvent
.
#oracle.jbo.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.
See
.
ViewObject.isInternal()
getViewObject
in interface RowSet
public boolean setMasterRowSetIterator(RowSetIterator masterRS)
RowSet
setMasterRowSetIterator
in interface RowSet
masterRS
- a master Row Set Iterator.
true
if the operation succeeded.public boolean removeMasterRowSetIterator(RowSetIterator masterRS)
RowSet
removeMasterRowSetIterator
in interface RowSet
true
if masterRS
was found,
false
otherwise.public RowSetIterator[] getMasterRowSetIterators()
RowSet
getMasterRowSetIterators
in interface RowSet
public AttributeDef addDynamicAttribute(java.lang.String attrName)
ViewObject
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.
This method should not be overridden.
addDynamicAttribute
in interface ViewObject
attrName
- the name of the dynamic attribute.
public java.lang.Object getParent()
getParent
in interface ClientComponentObject
public ApplicationModule getApplicationModule()
RowSet
Strictly speaking, a Row Set belongs to a View Object and the View Object to an Application Module. This method returns the Application Module that cotains the View Object, which contains this Row Set.
If this Row Set is the result of calling a View Link accessor,
this Row Set belongs to an internal View Object (see
).
Such an internal View Object belongs to the root Application Module.
Put differently, if you call this method on a Row Set which is the result
of calling a View Link accessor, it will return the root Application Module.
ViewObject.isInternal()
getApplicationModule
in interface RowSet
ApplicationModule
to which this Row Set belongs.public void addListener(java.lang.Object target)
NavigatableRowIterator
RowSetListener
events generated by this row set iterator.
addListener
in interface NavigatableRowIterator
target
- the subscriber to be added. It should implement
RowSetListener
.public void addInternalListener(java.lang.Object target)
addInternalListener
in interface InternalListenerManager
public void removeInternalListener(java.lang.Object target)
removeInternalListener
in interface InternalListenerManager
public void removeListener(java.lang.Object target)
NavigatableRowIterator
RowSetListener
events generated by this row set iterator.
removeListener
in interface NavigatableRowIterator
target
- the subscriber to be removed.public void addManagementListener(RowSetManagementListener target)
RowSetIterator
RowSetManagementListener
events generated by this Row Set Iterator.
addManagementListener
in interface RowSetIterator
target
- the subscriber to be added. It should implement
RowSetManagementListener
.public void removeManagementListener(RowSetManagementListener target)
RowSetIterator
RowSetManagementListener
events generated by this row set iterator.
removeManagementListener
in interface RowSetIterator
target
- the subscriber to be removed.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 RowSetListener
event
- a description of the new and previous current rows.public RowSet createRowSet(java.lang.String name)
ViewObject
createRowSet
in interface ViewObject
name
- the name for the new RowSet
.
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 RowSet[] getRowSets()
getRowSets
in interface ViewObject
public RowSet findRowSet(java.lang.String name)
ViewObject
findRowSet
in interface ViewObject
name
- a Row Set name. If null
, it returns the
the View Object.
null
if the named Row Set is not
not found.public RowSetIterator createRowSetIterator(java.lang.String name)
RowSet
createRowSetIterator
in interface RowSet
name
- the name to be given to the iterator.
this
.public RowSetIterator[] getRowSetIterators()
RowSet
getRowSetIterators
in interface RowSet
public RowSetIterator findRowSetIterator(java.lang.String name)
RowSet
findRowSetIterator
in interface RowSet
name
- 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()
RowIterator
getRowCountInRange
in interface RowIterator
public boolean isReadOnly()
ViewObject
A view is read-only if it does not have Primary Keys or if all its entity references are reference-only.
This method should not be overridden.
isReadOnly
in interface ViewObject
true
if this View Object is
read-only; false if it is updateable.protected void addViewLink(ViewLink viewLink)
protected void removeViewLink(ViewLinkImpl viewLink)
protected ViewLink[] getViewLinks()
public RowSet[] getDetailRowSets()
getDetailRowSets
in interface RowSetIterator
public RowSet createDetailRowSet(java.lang.String voName, java.lang.String linkDefName)
createDetailRowSet
in interface RowSetIterator
voName
- the name of the new detail Row Set.linkDefName
- the name of a View Link definition.
This View Link chooses the relationship in which
this Iterator is the master and the new Row Set
is the detail. It must be a fully qualified
name (including the package name).
public ViewCriteria createViewCriteria()
createViewCriteria
in interface ViewObject
ViewCriteria
,
ViewObject.applyViewCriteria(ViewCriteria)
public void applyViewCriteria(ViewCriteria criteria)
applyViewCriteria
in interface ViewObject
criteria
- a view criteria object.public ViewCriteria getViewCriteria()
getViewCriteria
in interface ViewObject
null
if none is specified.public Key createKey(AttributeList nvp)
createKey
in interface RowIterator
public Row[] findByKey(Key key, int maxNumOfRows)
RowIterator
If this View Object has multiple Entity Object bases, the key need not be specified for all. However, if a key is specified for n-th Entity Object, and if this Entity Object's primary key consists of multiple parts, all parts of the key must be specified.
If not all Entity keys are included, multiple rows may
match the partial key. The maxNumOfRows
parameter
is used to specify the maximum number of rows to return.
For example, suppose the View Object has Emp and DeptLocation as its Entity Object bases. Suppose further that Emp has a one part primary key (employee number) and DeptLocation has a two part primary key (dept name and location).
The user can make the following call to look for all employees working in ACCOUNTING's NEW YORK office:
// The key will consist of 3 parts. The first part is // for the employee number (which is null, meaning not // specified). The second part is the department name. // The third is the location. Object [] keyValues = new Object[3]; keyValues[0] = null; // All employees keyValues[1] = "ACCOUNTING"; keyValues[4] = "NEW YORK"; // third Entity Object, key part 1 Row[] rows = myAM.findViewObject(new Key(keyValues), -1);
In this example, if you were to include the key for DeptLocation, you must specify both key parts.
Note that the position of the key must patch the order of the Entity Object bases and their keys. In the above example, keyValues[0] is always the employee number. You cannot specify the employee number in keyValues[1] or keyValues[2].
This method works even on a View Object which has no Entity Object
base. For this to work, however, the ViewObject's key
attribute list must have been set up through a call to
Then, the following code block will retrieve all rows whose
attribute 0 is "PERM" and attribute 2 is 30.
Internally,
If the requested number of rows have been found, the array
returns. Otherwise, a check is made to see if the View Object's
fetch size is unlimited (which is -1, see
Otherwise (the requested number of rows not yet found and
the Row Set has not yet fetched all rows or the fetch size
is not -1), the search continues. We now use the
For a View Object which has no Entity Object base, we
simply skip the step of looking in the Entity Object cache.
Other than that, the logic is applied.
As new rows are retrieved from database they are added to the
Row Set collection. Thus, the user can work with these rows immediately,
e.g., call
This method does not fire any navigation event, nor does it
move the range or the current row. Also, as rows are added to
the Row Set collection, no insertion event fires (as this is
analogous to fetching rows).
See
#oracle.jbo.server.ViewObjectImpl.setKeyAttributeDefs(int[])
.
For example, suppose we have a View Object with 5 attributes where
attribute 0 and 2 are to be its key attributes.
// First set up the key attributes
myVO.setKeyAttributeDefs(new int[] { 0, 2 });
// The key will consist of 2 parts. The first part is
// for attribtue 0 and the second is for attribute 2.
Object [] keyValues = new Object[2];
keyValues[0] = "PERM";
keyValues[1] = new Integer(30);
Row[] rows = myAM.findViewObject(new Key(keyValues), -1);
findByKey()
works as follows for
a View Object with Entity Object bases: It takes the first
non-null
entity key from key
.
It uses it to find the Entity row in the cache. If it
finds it, then it looks at all View rows in the Row Set collection
that uses that Entity row and apply the remaining keys to qualify them.
It may or may not find as many rows as requested.
) and
the Row Set has fetched all the rows out of database into its
collection. If this is the case, we return the array
even if the requested number of rows have not been found.
This is because these conditions imply that all rows have
been brought into Row Set collection and no further search is
necessary.
#ViewObject.setMaxFetchSize()
key
build a where-clause for an internal View Object. That
where-clause is applied and qualifying rows are retrieved from
it to find the requested number of rows.
with one
of them. Care is applied to make sure the same row is not added to
the Row Set collection multiple times.
RowIterator.setCurrentRow(Row)
for comparison between this
method and RowIterator.getRow(Key)
getRow(Key)
.
findByKey
in interface RowIterator
key
- the key to match.maxNumOfRows
- the maximum size of the array to return,
or -1 to return all rows.
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.
protected byte[] getPiggyback()
protected ServiceMessage getServiceMessage()
protected void processPiggyback(byte[] pb)
protected com.sun.java.util.collections.ArrayList processServiceMessage(ServiceMessage svcMsg)
public boolean isForwardOnly()
RowSet
isForwardOnly
in interface RowSet
true
if the Row Set is restricted to forward-only processing.RowSet.setForwardOnly(boolean)
public void setForwardOnly(boolean isForwardOnly)
RowSet
When set to true
,
a row preceeding the current row cannot be designated as the
new current row. This restriction allows performance to be optimized.
setForwardOnly
in interface RowSet
isForwardOnly
- true
restricts the Row Set to forward-only processing,
false
otherwise.public byte getAccessMode()
getAccessMode
in interface RowSet
RowSet.setAccessMode(byte)
public void setAccessMode(byte mode)
RowSet
SCROLLABLE
- if this RowSet should fetch rows
and cache the ViewRows in a collection. This is the most flexible
mode for accessing rows and working with a RowSet.
FORWARD_ONLY
- if this RowSet should only provide
sequential access to Rows in its collection. The iterators on this
RowSet will not allow scrolling back.
RANGE_PAGING
- if this RowSet should fetch rows
in ranges (set using setRangeSize() - the default range size is -1 to
fetch all rows), such that on scroll to the
the next range or to fetch a row that's not in the current range,
it's fetched back from the database using ROWNUM query and the
row at the desired index is placed as the first row in the current
range. New rows inserted in this mode will be inserted at the beginning of the rowset to maintain their row indices.
If an attempt is made to get a row outside of the range when a new row is inserted or a row is removed in the current range, then an InvalidOperException is raised as the current set of changes needs to be posted to recalculate the right ROWNUM.
RANGE_PAGING_AUTO_POST
- if this rowset should also
post any changes in this transaction to access a row out of the current
range.
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
mode
- One of the four enumerated values SCROLLABLE
,
FORWARD_ONLY
, RANGE_PAGING
, RANGE_PAGING_AUTO_POST
public boolean isAssociationConsistent()
RowSet
isAssociationConsistent
in interface RowSet
true
if un-posted changes are visible,
false
otherwise.RowSet.setAssociationConsistent(boolean)
public void setAssociationConsistent(boolean isConsistent)
RowSet
Association-consistent mode allows the user to see data that includes changes not yet posted to database, but at the cost of degraded performance.
When association-consistency is on the Row Set will reflect rows with modified foreign keys, newly created rows, and removed (deleted) rows. When association-consistency is off the user must post pending changes to database to make them visible.
This method is relevant only if this Row Set was one returned from a call to an entity association accessor.
setAssociationConsistent
in interface RowSet
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 isFetchComplete()
RowSet
isFetchComplete
in interface RowSet
true
if the result set has been
fetched to the end.public AttributeDef addViewLinkAccessor(java.lang.String accrName)
protected void finalize()
public AttributeDef findViewLinkAccessor(ViewLink vl)
ViewObject
findViewLinkAccessor
in interface ViewObject
vl
- the view link whose accessor is being sought.
null
if not.protected ObjectMarshaller getObjectMarshaller()
public Node writeXML(long options, com.sun.java.util.collections.HashMap voAttrMap)
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 writeXMLvoAttrMap
- 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)
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 depthcount parameter represents to what level the rendering should recurse. A depthcount of zero (0) means do not traverse any View Links while rendering. One (1) means traverse the View Links on this object but no View Links thereafter, and so on.
The options parameter represents a set of bit flags that will control the writeXML behavior. The following bit flags have been defined:
EntityImpl
.
writeXML
in interface XMLInterface
depthCount
- represents to what level the rendering should recurse.options
- a set of bit flags that will control the writeXML
behavior.public void readXML(Element elem, int depthCount)
readXML
in interface XMLInterface
public Node writeXML(long options, com.sun.java.util.collections.HashMap voAttrMap, XSLStylesheet xslt)
writeXML
in interface XMLInterface
public Node writeXML(int depthCount, long options, XSLStylesheet xslt)
writeXML
in interface XMLInterface
public void readXML(Element elem, int depthCount, XSLStylesheet xslt)
readXML
in interface XMLInterface
public void readRowXML(Element elem, 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 int getMaxFetchSize()
ViewObject
getMaxFetchSize
in interface ViewObject
public void setMaxFetchSize(int max)
ViewObject
Passing -1 to this method will retrieve an unlimited number of rows. This is the default.
Passing 0 to this method will cause the database query not to be executed. The View Object will initially work with an empty row set. If you want to execute query later, call setMaxFetchSize again with a non-zero argument, then call executeQuery().
setMaxFetchSize
in interface ViewObject
public static oracle.jbo.client.remote.RowSetIteratorImpl getImplObject(java.lang.Object rsi)
public void setQueryOptimizerHint(java.lang.String hintText)
setQueryOptimizerHint
in interface ViewObject
public java.lang.String getQueryOptimizerHint()
ViewObject
getQueryOptimizerHint
in interface ViewObject
protected ApplicationModuleImpl getApplicationModuleProxy()
public void findAndSetCurrentRowByKey(Key k, int rangeIndex)
findAndSetCurrentRowByKey
in interface WSRowSetIteratorMarshaller
public int getDynamicAttributeOffset()
getDynamicAttributeOffset
in interface ViewObjectDynAttr
public int getDynamicAttributeCount()
getDynamicAttributeCount
in interface ViewObjectDynAttr
|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.