. Suppose Depts 10 and 20 are located in "New York"
and Dept 30
in "San Jose", and "New York" has two temp agencies "ABC and DEF", and
"San Jose" has "GHI and JKL".
This scenario has two query collections on the
detail (TempAgency) side, for "New York" and "San Jose".
If the application invokes the assocation/View Link accessor to get the
temp agencies from Dept, each Dept produces a view row set.
Two view row sets, for Depts 10 and 20
show temp agencies in "New York", and Dept 30 shows
the temp agencies in "San Jose".
The first two view row sets share the same query collection, and the third has its own.
An internal table of master-key/query-collection pairs,
the query collection hash table, is maintained for the View Object.
When a new detail view row set is created, it checks this hash table
to see if a query collection of the master key value already is in the list,
and if found, uses it. Otherwise, the query is executed and
a new query collection is created.
The position of a row inserted in the middle of the row set is
temporary in that when the data is posted to the database, this
position will not be preserved in the database. If the row set is
executed again, refreshing its data from the database, the new row will
appear in the position returned by the database.
- Since:
- JDeveloper 3.0
- See Also:
ViewObject
,
RowSet
,
ViewObjectImpl
,
ViewRowSetIteratorImpl
Type | Method |
void |
addListener(java.lang.Object listener)
Adds an event listener to this object. |
void |
addManagementListener(RowSetManagementListener listener)
Adds a subscriber (listener) to be notified of RowSetManagementListener
events generated by this row set iterator. |
protected void |
close()
Closes the view row set. |
void |
closeRowSet()
Closes the row set. |
void |
closeRowSetIterator()
Closes this row set iterator. |
RowSet |
createDetailRowSet(java.lang.String rsName,
java.lang.String linkDefName)
Creates and returns an new detail row set for this row set iterator. |
Key |
createKey(AttributeList nvp)
Given a list of name-value pairs, creates a Key object that
matches the key structure for the ViewObject for this RowItertor. |
Row |
createRow()
Creates a new view row. |
RowSetIterator |
createRowSetIterator(java.lang.String name)
Creates and returns a new row set iterator on this row set. |
static void |
dumpViewRowCache(RowSetIterator rsi,
java.io.Writer out)
Internal: Applications should not use this method.
|
java.util.Enumeration |
enumerateRowsInRange()
Creates and returns an enumerator of the rows in the range. |
void |
execute(boolean forceFlag,
boolean notifyFlag)
Executes the query. |
void |
executeQuery()
Executes the query. |
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 key specified in
key . |
RowSetIterator |
findRowSetIterator(java.lang.String rsiName)
Gets the named Row Set Iterator that was created at runtime for this Row Set. |
Row |
first()
Navigates to the first row in the row set. |
Row[] |
getAllRowsInRange()
Returns an array of all rows in the iterator's range. |
ApplicationModule |
getApplicationModule()
Returns the application module to which this row set's View Object
belongs. |
int[] |
getCollMgmtInfo()
|
Row |
getCurrentRow()
Returns the current row of the iterator. |
int |
getCurrentRowIndex()
Returns the absolute row index of the current row in the row set. |
int |
getCurrentRowSlot()
Returns the current row slot status. |
ViewRowSetIteratorImpl |
getDefaultRowSetIterator()
Returns the default ViewRowSetIteratorImpl . |
RowSet[] |
getDetailRowSets()
Returns an array of all detail row sets for this row set iterator. |
long |
getEstimatedRowCount()
Returns an estimated number of rows in this row set. |
int |
getFetchedRowCount()
Returns the number of rows fetched from the JDBC RestultSet . |
int |
getIterMode()
Gets the current iteration mode. |
RowSetIterator[] |
getMasterRowSetIterators()
Returns an array of all master row set iterators for this row
set. |
java.util.Vector |
getMasterViewRowSetIterators()
Returns a list of all master row set iterators for this row
set. |
com.sun.java.util.collections.ArrayList |
getMasterViewRowSetIteratorsList()
Returns a list of all master row set iterators for this row
set. |
java.lang.Object[] |
getParameters(boolean nullValueFlag)
Returns an array of bind values to be used for binding to the
query. |
java.lang.Object[] |
getParametersAsStorageTypes()
Returns an array of bind values to be used for binding to the
query. |
java.util.Hashtable |
getProperties()
Retrieves all properties. |
QueryCollection |
getQueryCollection()
Internal: Applications should not use this method.
|
int |
getRangeIndexOf(Row row)
Returns the range index of the row specified by row . |
int |
getRangeSize()
Returns the range size of the iterator. |
int |
getRangeStart()
Returns the absolute row index of the first row in the range. |
Row |
getRow(int index)
Returns the row at absolute row index of index . |
Row |
getRow(Key key)
Returns the first row whose key matches key . |
Row |
getRowAtRangeIndex(int index)
Returns the row at range index index . |
int |
getRowCount()
Returns the total number of rows in this row set. |
int |
getRowCountInRange()
Returns the actual number of rows in the range. |
Row |
getRowFromHandle(java.lang.Object rowHandle)
Internal: Applications should not use this method.
|
protected Row[] |
getRows(EntityImpl entity)
Returns an array of view rows that use the specified entity row. |
RowSet |
getRowSet()
Implements RowSetIterator.getRowSet . |
RowSetIterator |
getRowSetIterator()
Returns the row set iterator interface of this object. |
RowSetIterator[] |
getRowSetIterators()
Gets all Row Set Iterators that belong to this row set. |
java.lang.Object |
getSyncLock()
Gets the locking object for this Row Set Iterator. |
ViewObject |
getViewObject()
Returns this row set's View Object. |
java.lang.Object[] |
getWhereClauseParams()
Returns an array of bind values currently specified for the query. |
boolean |
hasNext()
Indicates whether the iterator has a next row or not. |
boolean |
hasPrevious()
Indicates whether the iterator has a previous row or not. |
void |
insertRow(Row row)
Inserts the row into the row set. |
Row |
insertRowAt(int index,
Row row)
Inserts a view row at an absolute row index specified by
index . |
void |
insertRowAtRangeIndex(int index,
Row row)
Inserts the row into the row set at the specified range index. |
boolean |
isAssociationConsistent()
Returns the association-consistent flag for this row set. |
boolean |
isDefaultRS()
Internal: Applications should not use this method.
|
boolean |
isDirty()
Indicates whether data modifications have been performed since
the last database post through this row set. |
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. |
boolean |
isForwardOnly()
Indicates whether this row set is forward-only or not. |
boolean |
isNameGenerated()
Tests if the iterator's name was generated by the system. |
protected boolean |
isNotifiedRefresh()
Indicates whether row set refresh event has been notified to the
row set's listeners or not. |
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. |
Row |
last()
Navigates to the last row in the row set. |
ViewRowImpl |
makeRowCopy(ViewRowImpl vr)
|
Row |
next()
Navigates to the next row in the row set. |
Row |
previous()
Navigates to the previous row in the row set. |
void |
printActiveObjsTab(java.io.PrintWriter pw)
|
void |
printColl(java.io.PrintWriter pw,
int printFlag)
|
void |
printRUChain(java.io.PrintWriter pw)
|
void |
readXML(Element elem,
int depthCount)
|
void |
readXML(Element elem,
int depthCount,
XSLStylesheet xslt)
|
void |
removeCurrentRow()
Removes the current row. |
void |
removeListener(java.lang.Object listener)
Removes an event listener to this object from the listener list. |
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 in a master-detail View Link. |
void |
removeRowAt(int index)
Removes a view row at an absolute row index specified by
index . |
void |
removeRowHandle(java.lang.Object rowHandle)
Internal: Applications should not use this method.
|
void |
reset()
Resets the iterator. |
int |
scrollRange(int amount)
Scrolls the range by amount . |
int |
scrollRangeTo(Row row,
int index)
Scrolls the range to a specific row. |
void |
setAssociationConsistent(boolean isConsistent)
Sets the association-consistent flag for this row set. |
boolean |
setCurrentRow(Row row)
Moves the iterator to the row specified by row . |
boolean |
setCurrentRowAtRangeIndex(int index)
Moves the iterator to the row whose range index is index . |
void |
setForwardOnly(boolean isForwardOnly)
Sets whether this row set will be forward-only or not. |
void |
setIterMode(int mode)
Sets the iteration mode for this Row Iterator. |
boolean |
setMasterRowSetIterator(RowSetIterator masterRSI)
Sets the master row set iterator in a master-detail View Link. |
int |
setRangeSize(int size)
Sets the range size for the iterator. |
int |
setRangeStart(int start)
Sets the range position by the absolute row index specified in
start . |
void |
setRowValidation(boolean flag)
Sets the validation flag on this iterator. |
void |
setWhereClauseParam(int index,
java.lang.Object value)
Sets the bind value at a specified index . |
void |
setWhereClauseParams(java.lang.Object[] values)
Sets bind values for the query. |
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 voAttrRules)
Renders data in a canonical XML-format. |
Node |
writeXML(long options,
com.sun.java.util.collections.HashMap map,
XSLStylesheet xslt)
|
Methods inherited from class oracle.jbo.common.RowSetHelper |
fireMgmtIteratorClosed, fireMgmtIteratorReset,
fireNavigationEvent, fireRangeRefreshed, fireRangeScrolled, fireRowDeleted, fireRowInserted,
fireRowUpdated, getListeners, getListenersList,
getManagementListenersList, getName, hasListeners,
hasManagementListeners, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mQRef
protected ViewObjectImpl mQRef
mViews
protected com.sun.java.util.collections.ArrayList mViews
mDefaultView
protected ViewRowSetIteratorImpl mDefaultView
mMasterViews
protected com.sun.java.util.collections.ArrayList mMasterViews
mUserParams
protected com.sun.java.util.collections.ArrayList mUserParams
mParamValues
protected java.lang.Object[] mParamValues
VIEWLINK_MODE_UNINITIALIZED
public static final byte VIEWLINK_MODE_UNINITIALIZED
VIEWLINK_MODE_INCONSISTENT
public static final byte VIEWLINK_MODE_INCONSISTENT
VIEWLINK_MODE_CONSISTENT
public static final byte VIEWLINK_MODE_CONSISTENT
mDefaultViewLinkMode
public static byte mDefaultViewLinkMode
ViewRowSetImpl
public ViewRowSetImpl(ViewObjectImpl vo,
java.lang.String name,
ViewRowSetIteratorImpl masterRSI)
- Constructs a new secondary (non-default) view row set.
- Parameters:
vo
- the View Object to which this view row set belongs.name
- name to be given to this view row set.
If null
, the view row set is
assigned the default row set name, which is
the View Object's name, plus "_RowSet".masterRSI
- the master row set iterator if this view row set
will be detail in a master-detail relationship.
null
otherwise.
getSyncLock
public final java.lang.Object getSyncLock()
- Description copied from interface:
RowSetIterator
- Gets the locking object for this Row Set Iterator.
Actually, this method locks the Application Module to which this
Row Set Iterator belongs. See
ApplicationModule.getSyncLock()
for details.
- Specified by:
getSyncLock
in interface RowSetIterator
- Following copied from interface:
oracle.jbo.RowSetIterator
- Returns:
- the locking object.
isNameGenerated
public final boolean isNameGenerated()
- Description copied from interface:
RowSetIterator
- Tests if the iterator's name was generated by the system.
- Specified by:
isNameGenerated
in interface RowSetIterator
- Following copied from interface:
oracle.jbo.RowSetIterator
- Returns:
true
if the name was generated by the system.
false
if the name was given by the user and
not generated by the system.
isDefaultRS
public boolean isDefaultRS()
- Internal: Applications should not use this method.
Indicates whether this row set is the default row set for the
View Object.
- Returns:
- indicates whether this row set is the default row set for the
View Object.
close
protected void close()
- Closes the view row set.
It closes all row set iterators, removes itself from all master
row set iterators, and possibly remove the query collection from the query collection list.
closeRowSet
public void closeRowSet()
- Description copied from interface:
RowSet
- Closes the row set. It closes all row set iterators that belong
to this row set. If this row set is a detail row set in a
master-detail relationship,
closeRowSet
removes
this row set from the master row set iterator.
- Specified by:
closeRowSet
in interface RowSet
closeRowSetIterator
public void closeRowSetIterator()
- Description copied from interface:
RowSetIterator
- Closes this row set iterator. If this row set iterator is a master
in a master-detail relationship,
closeRowSetIterator
closes all detail row sets.
After that, it fires a RowSetManagementListener.iteratorClosed
event to its RowSetManagementListener's
.
Then, it deregisters this row set iterator from the owning row set,
and deregisters all its listeners.
- Specified by:
closeRowSetIterator
in interface RowSetIterator
execute
public void execute(boolean forceFlag,
boolean notifyFlag)
- Executes the query.
forceFlag
controls whether a new query collection should be
force-created or not. If true, the query collection list is not consulted and
a new query collection is created. If false, we check the query collection list to see if one
with the key exists. If so, we reuse the existing one.
If forceFlag
is true, the application may see a different
set of rows than before, depending on the where-clause and data
modifications performed by this application or other users.
See ViewObjectImpl.executeQuery
for explanation.
- Parameters:
forceFlag
- indicates whether to force-create the query collection.notifyFlag
- indicates whether to send notification or not.
If true, each row set iterator will fire
a range refreshed event.- See Also:
ViewObjectImpl.executeQuery()
executeQuery
public void executeQuery()
- Executes the query.
See ViewObjectImpl.executeQuery
for details.
- Specified by:
executeQuery
in interface RowSet
- See Also:
ViewObjectImpl.executeQuery()
createRowSetIterator
public RowSetIterator createRowSetIterator(java.lang.String name)
- Creates and returns a new row set iterator on this row set.
- Specified by:
createRowSetIterator
in interface RowSet
- Parameters:
name
- the name of the new row set iterator.- Returns:
- the new row set iterator.
getRowSetIterators
public RowSetIterator[] getRowSetIterators()
- Description copied from interface:
RowSet
- Gets all Row Set Iterators that belong to this row set.
- Specified by:
getRowSetIterators
in interface RowSet
- Following copied from interface:
oracle.jbo.RowSet
- Returns:
- the array of Row Set Iterators.
findRowSetIterator
public RowSetIterator findRowSetIterator(java.lang.String rsiName)
- Description copied from interface:
RowSet
- Gets the named Row Set Iterator that was created at runtime for this Row Set.
- Specified by:
findRowSetIterator
in interface RowSet
- Following copied from interface:
oracle.jbo.RowSet
- Parameters:
rsiName
- a Row Set Iterator name. If null
, it returns the
the Row Set.- Returns:
- the Row Set Iterator.
null
if the named Row Set Iterator is not
not found.
isExecuted
public boolean isExecuted()
- Indicates whether the row set has been executed or not.
- Specified by:
isExecuted
in interface RowSet
- Returns:
- true if the row set has been executed.
getQueryCollection
public final QueryCollection getQueryCollection()
- Internal: Applications should not use this method.
Returns the query collection for this row set.
- Returns:
- the QueryCollection for this row set.
getDefaultRowSetIterator
public ViewRowSetIteratorImpl getDefaultRowSetIterator()
- Returns the default
ViewRowSetIteratorImpl
.
The default row set iterator has the same name as this row set object.
- Returns:
- the default row set iterator.
addListener
public void addListener(java.lang.Object listener)
- Adds an event listener to this object.
listener
should implement the RowSetListener
interface.
- Specified by:
addListener
in interface NavigatableRowIterator
- Overrides:
addListener
in class RowSetHelper
- Parameters:
listener
- the RowSetListener
registering
interest in this object's events.
removeListener
public void removeListener(java.lang.Object listener)
- Removes an event listener to this object from the listener list.
listener
should implement the RowSetListener
interface.
- Specified by:
removeListener
in interface NavigatableRowIterator
- Overrides:
removeListener
in class RowSetHelper
- Parameters:
listener
- the RowSetListener
to be removed.
addManagementListener
public void addManagementListener(RowSetManagementListener listener)
- Description copied from interface:
RowSetIterator
- Adds a subscriber (listener) to be notified of
RowSetManagementListener
events generated by this row set iterator.
- Specified by:
addManagementListener
in interface RowSetIterator
- Overrides:
addManagementListener
in class RowSetHelper
- Following copied from interface:
oracle.jbo.RowSetIterator
- Parameters:
listener
- the subscriber to be added. It should implement
RowSetManagementListener
.
removeManagementListener
public void removeManagementListener(RowSetManagementListener listener)
- Description copied from interface:
RowSetIterator
- Removes a subscriber (listener) for
RowSetManagementListener
events generated by this row set iterator.
- Specified by:
removeManagementListener
in interface RowSetIterator
- Overrides:
removeManagementListener
in class RowSetHelper
- Following copied from interface:
oracle.jbo.RowSetIterator
- Parameters:
listener
- the subscriber to be removed.
getMasterViewRowSetIteratorsList
public com.sun.java.util.collections.ArrayList getMasterViewRowSetIteratorsList()
- Returns a list of all master row set iterators for this row
set.
- Returns:
- a list of all master row set iterators for this row set.
getMasterViewRowSetIterators
public java.util.Vector getMasterViewRowSetIterators()
- Returns a list of all master row set iterators for this row
set.
- Returns:
- a list of all master row set iterators for this row set.
setMasterRowSetIterator
public boolean setMasterRowSetIterator(RowSetIterator masterRSI)
- Sets the master row set iterator in a master-detail View Link.
See ViewObjectImpl.setMasterRowSetIterator
for details.
- Specified by:
setMasterRowSetIterator
in interface RowSet
- Parameters:
masterRSI
- master row set iterator.- Returns:
- indicates whether the master row set iterator was
successfully set or not.
- See Also:
ViewObjectImpl.setMasterRowSetIterator(RowSetIterator)
removeMasterRowSetIterator
public boolean removeMasterRowSetIterator(RowSetIterator masterRSI)
- Removes the master row set iterator in a master-detail View Link.
See ViewObjectImpl.removeMasterRowSetIterator
for details.
- Specified by:
removeMasterRowSetIterator
in interface RowSet
- Parameters:
masterRSI
- master row set iterator to remove.- Returns:
- indicates whether the master row set iterator was
successfully removed or not.
- See Also:
ViewObjectImpl.removeMasterRowSetIterator(RowSetIterator)
isDirty
public boolean isDirty()
- Indicates whether data modifications have been performed since
the last database post through this row set.
- Returns:
- flag indicating whether the row set is dirty.
isNotifiedRefresh
protected boolean isNotifiedRefresh()
- Indicates whether row set refresh event has been notified to the
row set's listeners or not.
- Returns:
- flag indicating whether refresh was notified or not.
makeRowCopy
public ViewRowImpl makeRowCopy(ViewRowImpl vr)
insertRowAt
public Row insertRowAt(int index,
Row row)
- Inserts a view row at an absolute row index specified by
index
.
An absolute row index is a row index in the entire row set.
It starts at 0.
- Parameters:
index
- absolute row index at which the row is to be inserted.row
- the row to inserted.
removeRowAt
public void removeRowAt(int index)
- Removes a view row at an absolute row index specified by
index
.
An absolute row index is a row index in the entire row set.
It starts at 0.
- Parameters:
index
- absolute row index of the row to remove.
createRow
public Row createRow()
- Creates a new view row.
See ViewObjectImpl.createRow
for details.
- Specified by:
createRow
in interface RowIterator
- Returns:
- the new view row.
- See Also:
ViewObjectImpl.createRow()
getRowCount
public int getRowCount()
- Returns the total number of rows in this row set.
See ViewObjectImpl.getRowCount
for details.
- Specified by:
getRowCount
in interface RowIterator
- Returns:
- the number of rows in the row set.
- See Also:
ViewObjectImpl.getRowCount()
getEstimatedRowCount
public long getEstimatedRowCount()
- Returns an estimated number of rows in this row set.
See ViewObjectImpl.getEstimatedRowCount
for details.
- Specified by:
getEstimatedRowCount
in interface RowSet
- Returns:
- an estimated number of rows in the row set.
- See Also:
ViewObjectImpl.getEstimatedRowCount()
getMasterRowSetIterators
public RowSetIterator[] getMasterRowSetIterators()
- Returns an array of all master row set iterators for this row
set.
- Specified by:
getMasterRowSetIterators
in interface RowSet
- Returns:
- an array of all master row set iterators for this row set.
getApplicationModule
public ApplicationModule getApplicationModule()
- Returns the application module to which this row set's View Object
belongs.
- Specified by:
getApplicationModule
in interface RowSet
- Returns:
- the ApplicationModule this View Object belongs to.
getViewObject
public ViewObject getViewObject()
- Returns this row set's View Object.
- Specified by:
getViewObject
in interface RowSet
- Returns:
- the
ViewObject
this row set belongs to.
getRowSet
public RowSet getRowSet()
- Implements
RowSetIterator.getRowSet
.
- Specified by:
getRowSet
in interface RowSetIterator
- Returns:
- the row set interface of this object.
getRowSetIterator
public RowSetIterator getRowSetIterator()
- Returns the row set iterator interface of this object.
- Returns:
- the row set interface of this object.
setRangeSize
public int setRangeSize(int size)
- Sets the range size for the iterator.
See ViewObjectImpl.setRangeSize
for details.
- Specified by:
setRangeSize
in interface RowIterator
- Parameters:
size
- the new range size.- Returns:
- the new range size.
- See Also:
ViewObjectImpl.setRangeSize(int)
getRangeSize
public int getRangeSize()
- Returns the range size of the iterator.
See ViewObjectImpl.getRangeSize
for details.
- Specified by:
getRangeSize
in interface RowIterator
- Returns:
- the range size.
- See Also:
ViewObjectImpl.getRangeSize()
getRangeStart
public int getRangeStart()
- Returns the absolute row index of the first row in the range.
See ViewObjectImpl.getRangeStart
for details.
- Specified by:
getRangeStart
in interface RowIterator
- Returns:
- the absolute row index of the first row in the range.
- See Also:
ViewObjectImpl.getRangeStart()
setRangeStart
public int setRangeStart(int start)
- Sets the range position by the absolute row index specified in
start
.
See ViewObjectImpl.setRangeStart
for details.
- Specified by:
setRangeStart
in interface RowIterator
- Parameters:
start
- absolute row index of the row that should
be positioned as the first row of the range.
An absolute row index is a row index in the
entire row set. It starts at 0.- Returns:
- the absolute row index of the first row of the range.
- See Also:
ViewObjectImpl.setRangeStart(int)
scrollRange
public int scrollRange(int amount)
- Scrolls the range by
amount
.
See ViewObjectImpl.scrollRange
for details.
- Specified by:
scrollRange
in interface RowIterator
- Parameters:
amount
- the number of rows to scroll.- Returns:
- the actual number of rows scrolled. A negative number
indicates that the scroll was scrolled upward.
- See Also:
ViewObjectImpl.scrollRange(int)
scrollRangeTo
public int scrollRangeTo(Row row,
int index)
- Scrolls the range to a specific row.
See ViewObjectImpl.scrollRangeTo
for details.
- Specified by:
scrollRangeTo
in interface RowIterator
- Parameters:
row
- the row to scroll the range to.index
- the range index to position the row at.- Returns:
- the actual number of rows scrolled. A negative number
indicates that the scroll was scrolled upward.
- See Also:
ViewObjectImpl.scrollRangeTo(Row, int)
getAllRowsInRange
public Row[] getAllRowsInRange()
- Returns an array of all rows in the iterator's range.
See ViewObjectImpl.getAllRowsInRange
for details.
- Specified by:
getAllRowsInRange
in interface RowIterator
- Returns:
- an array of view rows.
- See Also:
ViewObjectImpl.getAllRowsInRange()
enumerateRowsInRange
public java.util.Enumeration enumerateRowsInRange()
- Creates and returns an enumerator of the rows in the range.
- Specified by:
enumerateRowsInRange
in interface RowIterator
- Returns:
- an enumerator.
getFetchedRowCount
public int getFetchedRowCount()
- Returns the number of rows fetched from the JDBC
RestultSet
.
- Specified by:
getFetchedRowCount
in interface RowIterator
- Returns:
- the number of rows fetched so far.
isRangeAtBottom
public boolean isRangeAtBottom()
- Indicates whether the iterator range contains the last row
of the row set.
See ViewObjectImpl.isRangeAtBottom
for details.
- Specified by:
isRangeAtBottom
in interface RowIterator
- Returns:
true
if the range contains the last row,
false
if not.- See Also:
ViewObjectImpl.isRangeAtBottom()
isRangeAtTop
public boolean isRangeAtTop()
- Indicates whether the iterator range contains the first row
of the row set.
See ViewObjectImpl.isRangeAtTop
for details.
- Specified by:
isRangeAtTop
in interface RowIterator
- Returns:
true
if the range contains the first row,
false
if not.- See Also:
ViewObjectImpl.isRangeAtTop()
insertRow
public void insertRow(Row row)
- Inserts the row into the row set.
This method does change currency. It sets
the inserted row to be the current row (for the RSI through
which the row is inserted). From an events standpoint,
insertRow will generate two events: insert
followed by
navigated.
See ViewObjectImpl.insertRow
for details.
- Specified by:
insertRow
in interface RowIterator
- Parameters:
row
- the view row to insert.- See Also:
ViewObjectImpl.insertRow(Row)
insertRowAtRangeIndex
public void insertRowAtRangeIndex(int index,
Row row)
- Inserts the row into the row set at the specified range index.
Using this method does not change currency.
See ViewObjectImpl.insertRowAtRangeIndex
for details.
- Specified by:
insertRowAtRangeIndex
in interface RowIterator
- Parameters:
index
- the range index into which the row is to be inserted.row
- the view row to insert.- See Also:
ViewObjectImpl.insertRowAtRangeIndex(int,
Row)
getRowFromHandle
public Row getRowFromHandle(java.lang.Object rowHandle)
- Internal: Applications should not use this method.
Returns the row with a handle specified by hdl
.
See
ViewObjectImpl#getRowFromHandle(Object)
for details.
- Parameters:
rowHandle
- the row handle.- Returns:
- the row identified by the row handle.
- See Also:
ViewObjectImpl.getRowFromHandle(Object)
removeRowHandle
public void removeRowHandle(java.lang.Object rowHandle)
- Internal: Applications should not use this method.
Removes the row handle from the row handle hash table.
See ViewObjectImpl.removeRowHandle
for details.
- Parameters:
rowHandle
- the row handle to remove.- See Also:
ViewObjectImpl.removeRowHandle(Object)
getRow
public Row getRow(Key key)
- Returns the first row whose key matches
key
.
See ViewObjectImpl.getRow
for details.
- Specified by:
getRow
in interface RowIterator
- Parameters:
key
- key to match.- Returns:
- the first matching row.
null
if no match. - See Also:
ViewObjectImpl.getRow(Key)
getRangeIndexOf
public int getRangeIndexOf(Row row)
- Returns the range index of the row specified by
row
.
See ViewObjectImpl.getRangeIndexOf
for details.
- Specified by:
getRangeIndexOf
in interface RowIterator
- Parameters:
row
- the row in question.- Returns:
- the range index of the row. -1 if the row is not within the
range.
- See Also:
ViewObjectImpl.getRangeIndexOf(Row)
removeCurrentRow
public void removeCurrentRow()
- Removes the current row.
See ViewObjectImpl.removeCurrentRow
for details.
- Specified by:
removeCurrentRow
in interface RowIterator
- See Also:
ViewObjectImpl.removeCurrentRow()
setRowValidation
public void setRowValidation(boolean flag)
- Description copied from interface:
RowIterator
- Sets the validation flag on this iterator. By default a
RowIterator validates the current row when navigating to
another row. This method can be used to turn this row-validation
off by passing 'false' as parameter.
- Specified by:
setRowValidation
in interface RowIterator
- Following copied from interface:
oracle.jbo.RowIterator
- Parameters:
flag
- Whether to turn row validation off or not.- Throws:
InvalidOperException
- is thrown if this iterator is
the default iterator of a ViewObject or a RowSet.
setCurrentRow
public boolean setCurrentRow(Row row)
- Moves the iterator to the row specified by
row
.
See ViewObjectImpl.setCurrentRow
for details.
- Specified by:
setCurrentRow
in interface RowIterator
- Returns:
- indicates whether the current row was successfully set or not.
- See Also:
ViewObjectImpl.setCurrentRow(Row)
setCurrentRowAtRangeIndex
public boolean setCurrentRowAtRangeIndex(int index)
- Moves the iterator to the row whose range index is
index
.
See ViewObjectImpl.setCurrentRowAtRangeIndex
for details.
- Specified by:
setCurrentRowAtRangeIndex
in interface RowIterator
- Parameters:
index
- range index to which to move the current row.- Returns:
- indicates whether the current row was successfully set or not.
- See Also:
ViewObjectImpl.setCurrentRowAtRangeIndex(int)
getCurrentRow
public Row getCurrentRow()
- Returns the current row of the iterator.
See ViewObjectImpl.getCurrentRow
for details.
- Specified by:
getCurrentRow
in interface RowIterator
- Returns:
- the current row.
null
if no current row. - See Also:
ViewObjectImpl.getCurrentRow()
getCurrentRowIndex
public int getCurrentRowIndex()
- Returns the absolute row index of the current row in the row set.
See ViewObjectImpl.getCurrentRowIndex
for details.
- Specified by:
getCurrentRowIndex
in interface RowIterator
- Returns:
- the absolute row index of the current row. -1 if the
row set has not be executed, or the iterator has just
been
reset
. - See Also:
ViewObjectImpl.getCurrentRowIndex()
getCurrentRowSlot
public int getCurrentRowSlot()
- Returns the current row slot status.
See ViewObjectImpl.getCurrentRowSlot
for details.
- Specified by:
getCurrentRowSlot
in interface RowIterator
- Returns:
- one of the slot status constants listed above.
- See Also:
ViewObjectImpl.getCurrentRowSlot()
getIterMode
public int getIterMode()
- Description copied from interface:
RowIterator
- Gets the current iteration mode. See Iteration Modes
above for details on iteration mode which controls how the range behaves when
it reaches the end of the Row Set.
- Specified by:
getIterMode
in interface RowIterator
- Following copied from interface:
oracle.jbo.RowIterator
- Returns:
- ITER_MODE_LAST_PAGE_PARTIAL if the iteration mode is
"partial-last-page", ITER_MODE_LAST_PAGE_FULL if it
is "full-last-page".
setIterMode
public void setIterMode(int mode)
- Description copied from interface:
RowIterator
- Sets the iteration mode for this Row Iterator. See Iteration Modes
above for details on iteration mode which controls how the range behaves when
it reaches the end of the Row Set.
- Specified by:
setIterMode
in interface RowIterator
- Following copied from interface:
oracle.jbo.RowIterator
- Parameters:
mode
- should be ITER_MODE_LAST_PAGE_PARTIAL if the iteration mode is
to be "partial-last-page", ITER_MODE_LAST_PAGE_FULL if it
is to be "full-last-page".
hasNext
public boolean hasNext()
- Indicates whether the iterator has a next row or not.
See ViewObjectImpl.hasNext
for details.
- Specified by:
hasNext
in interface RowIterator
- Returns:
true
if there is a next row,
false
if not.- See Also:
ViewObjectImpl.hasNext()
hasPrevious
public boolean hasPrevious()
- Indicates whether the iterator has a previous row or not.
See ViewObjectImpl.hasPrevious
for details.
- Specified by:
hasPrevious
in interface RowIterator
- Returns:
true
if there is a previous row,
false
if not.- See Also:
ViewObjectImpl.hasPrevious()
first
public Row first()
- Navigates to the first row in the row set.
See ViewObjectImpl.first
for details.
- Specified by:
first
in interface RowIterator
- Returns:
- the first row, which becomes the current row for the
iterator.
null
if the row set has no rows. - See Also:
ViewObjectImpl.first()
last
public Row last()
- Navigates to the last row in the row set.
See ViewObjectImpl.last
for details.
- Specified by:
last
in interface RowIterator
- Returns:
- the last row, which becomes the current row for the
iterator.
null
if the row set has no rows. - See Also:
ViewObjectImpl.last()
next
public Row next()
- Navigates to the next row in the row set.
See ViewObjectImpl.next
for details.
- Specified by:
next
in interface RowIterator
- Returns:
- the next row, which becomes the current row for the
iterator.
null
if no next row. If
no next row, the current row is not moved. - See Also:
ViewObjectImpl.next()
previous
public Row previous()
- Navigates to the previous row in the row set.
See ViewObjectImpl.previous
for details.
- Specified by:
previous
in interface RowIterator
- Returns:
- the previous row, which becomes the current row for the
iterator.
null
if no previous row. If
no previous row, the current row is not moved. - See Also:
ViewObjectImpl.previous()
reset
public void reset()
- Resets the iterator.
See ViewObjectImpl.reset
for details.
- Specified by:
reset
in interface RowIterator
- See Also:
ViewObjectImpl.reset()
getDetailRowSets
public RowSet[] getDetailRowSets()
- Returns an array of all detail row sets for this row set iterator.
See
ViewObjectImpl.getDetailRowSets
for details.
- Specified by:
getDetailRowSets
in interface RowSetIterator
- Returns:
- an array of all detail row sets for this row set iterator.
- See Also:
ViewObjectImpl.getDetailRowSets()
createDetailRowSet
public RowSet createDetailRowSet(java.lang.String rsName,
java.lang.String linkDefName)
- Creates and returns an new detail row set for this row set iterator.
See ViewObjectImpl.createDetailRowSet
for details.
- Specified by:
createDetailRowSet
in interface RowSetIterator
- Parameters:
rsName
- the name of the row set to be assigned to the new
detail row set.linkDefName
- identifies the View Link definition that defines
the master-detail relationship between this
row set iterator and the new detail row set.- Returns:
- the new detail row set.
- See Also:
ViewObjectImpl.createDetailRowSet(String,
String)
setForwardOnly
public void setForwardOnly(boolean isForwardOnly)
- Sets whether this row set will be forward-only or not.
See ViewObjectImpl.setForwardOnly
for details.
- Specified by:
setForwardOnly
in interface RowSet
- Parameters:
isForwardOnly
- indicates whether the row set should be
forward-only or not.- See Also:
ViewObjectImpl.setForwardOnly(boolean)
isForwardOnly
public boolean isForwardOnly()
- Indicates whether this row set is forward-only or not.
See ViewObjectImpl.isForwardOnly
for details.
- Specified by:
isForwardOnly
in interface RowSet
- Returns:
- indicates whether this row set is forward-only or not.
- See Also:
ViewObjectImpl.isForwardOnly()
setAssociationConsistent
public void setAssociationConsistent(boolean isConsistent)
- Sets the association-consistent flag for this row set.
See ViewObjectImpl.setAssociationConsistent
for details.
- Specified by:
setAssociationConsistent
in interface RowSet
- Parameters:
isConsistent
- indicates whether association-consistency
should be on or not.- See Also:
ViewObjectImpl.setAssociationConsistent(boolean)
isFetchComplete
public boolean isFetchComplete()
- Description copied from interface:
RowSet
- Tests if the query result set has been fetched to the end.
- Specified by:
isFetchComplete
in interface RowSet
- Following copied from interface:
oracle.jbo.RowSet
- Returns:
true
if the result set has been
fetched to the end.
isAssociationConsistent
public boolean isAssociationConsistent()
- Returns the association-consistent flag for this row set.
See ViewObjectImpl.isAssociationConsistent
for details.
- Specified by:
isAssociationConsistent
in interface RowSet
- Returns:
- the association-consistent flag for this row set.
- See Also:
ViewObjectImpl.isAssociationConsistent()
getRowCountInRange
public int getRowCountInRange()
- Returns the actual number of rows in the range.
See ViewObjectImpl.getRowCountInRange
for details.
- Specified by:
getRowCountInRange
in interface RowIterator
- Returns:
- the actual number of rows in the range.
- See Also:
ViewObjectImpl.getRowCountInRange()
setWhereClauseParams
public void setWhereClauseParams(java.lang.Object[] values)
- Sets bind values for the query.
See ViewObjectImpl.setWhereClauseParams
for details.
- Specified by:
setWhereClauseParams
in interface RowSet
- Parameters:
values
- an array of bind values.- See Also:
ViewObjectImpl.setWhereClauseParams(Object[])
setWhereClauseParam
public void setWhereClauseParam(int index,
java.lang.Object value)
- Sets the bind value at a specified
index
.
See ViewObjectImpl.setWhereClauseParam
for details.
- Specified by:
setWhereClauseParam
in interface RowSet
- Parameters:
index
- index of the bind value.value
- the bind value.- See Also:
ViewObjectImpl.setWhereClauseParam(int,
Object)
getWhereClauseParams
public java.lang.Object[] getWhereClauseParams()
- Returns an array of bind values currently specified for the query.
See
ViewObjectImpl.getWhereClauseParams
for details.
- Specified by:
getWhereClauseParams
in interface RowSet
- Returns:
- an array of bind values.
- See Also:
ViewObjectImpl.getWhereClauseParams()
getParametersAsStorageTypes
public java.lang.Object[] getParametersAsStorageTypes()
- Returns an array of bind values to be used for binding to the
query.
See ViewObjectImpl.getParametersAsStorageTypes
for details.
- Returns:
- an array of the bind values as torage types.
null
if there is no bind value to return. - See Also:
ViewObjectImpl.getParametersAsStorageTypes()
getRow
public Row getRow(int index)
- Returns the row at absolute row index of
index
.
An absolute row index is a row index in the entire row set.
It starts at 0.
- Parameters:
index
- the absolute row index.- Returns:
- the row.
null
if the index is invalid.
getRowAtRangeIndex
public Row getRowAtRangeIndex(int index)
- Returns the row at range index
index
.
Range index is a 0 based index within the range.
- Specified by:
getRowAtRangeIndex
in interface RowIterator
- Parameters:
index
- range index of the row.- Returns:
- the row at the specified range index.
null
if the index is outside the range, or if there is no
row at the specified index.
dumpViewRowCache
public static void dumpViewRowCache(RowSetIterator rsi,
java.io.Writer out)
- Internal: Applications should not use this method.
Debug routine that prints the view row cache content for the
query collection.
View row cache manages mapping between entity rows and view rows.
If a View Object consists of entities A, B, C, each view row
consists of three entity rows (from A, B, and C, respectively).
For this, the view row cache manages three hash tables,
each mapping the entity row to view rows that use it
as a constituent entity row.
This method dumps the content of that mapping to out
.
- Parameters:
rsi
- the row set iterator whose view row cache is to be
dumped.out
- where to dump the output.
getRows
protected Row[] getRows(EntityImpl entity)
- Returns an array of view rows that use the specified entity row.
A view row consists of entity rows. This method returns all
view rows (so far retrieved) that use the entity row specified
by entity
- Returns:
- an arry of rows that use
entity
.
null
if no view row uses entity
.
findByKey
public Row[] findByKey(Key key,
int maxNumOfRows)
- Finds and returns view rows that match the key specified in
key
.
See ViewObjectImpl.findByKey
for details.
- Specified by:
findByKey
in interface RowIterator
- Parameters:
key
- the key to match.maxNumOfRows
- the maximum size of the array to return,
or -1 to return all rows.- Returns:
- an array of rows matching the key.
- See Also:
ViewObjectImpl.findByKey(Key, int)
createKey
public Key createKey(AttributeList nvp)
- Description copied from interface:
RowIterator
- Given a list of name-value pairs, creates a Key object that
matches the key structure for the ViewObject for this RowItertor.
This Key object could be used as a valid argument to findByKey.
This Key will have null values for attributes expected in the
key structure for this ViewObject, but not found in the given
set of name-value pairs.
- Specified by:
createKey
in interface RowIterator
findByEntity
public Row[] findByEntity(int eRowHandle,
int maxNumOfRows)
- Description copied from interface:
RowIterator
- Finds and returns view rows that use the entity row, identified by
the entity row handle,
eRowHandle
.
- Specified by:
findByEntity
in interface RowIterator
- Following copied from interface:
oracle.jbo.RowIterator
- Parameters:
eRowHandle
- the entity row handle.maxNumOfRows
- the maximum size of the row array to return,
or -1 to return all rows.- Returns:
- an array of view rows that use the entity row.
getParameters
public java.lang.Object[] getParameters(boolean nullValueFlag)
- Returns an array of bind values to be used for binding to the
query.
This array is a union of the following set of bind values:
- Bind values supplied by the application (
setWhereClauseParam
).
- Bind values to be used for where-clause expressions built
from View Links. Values are supplied by the master row.
This method differs from getParametersAsStorageTypes
in that, if the bind values are domain instanes, this method returns
them as is, while getParametersAsStorageTypes
returns
the actual data out of the domain.
- Returns:
- an array of the bind values.
null
if there is no bind value to return.
getProperties
public java.util.Hashtable getProperties()
- Retrieves all properties. It is a union of properties on this
View Object and those on the view definition.
- Specified by:
getProperties
in interface Properties
- Overrides:
getProperties
in class PropertiesHelper
- Returns:
- hash table (name-value pairs) of all properties.
printActiveObjsTab
public void printActiveObjsTab(java.io.PrintWriter pw)
printRUChain
public void printRUChain(java.io.PrintWriter pw)
printColl
public void printColl(java.io.PrintWriter pw,
int printFlag)
getCollMgmtInfo
public int[] getCollMgmtInfo()
writeXML
public final Node writeXML(long options,
com.sun.java.util.collections.HashMap voAttrRules)
- Description copied from interface:
XMLInterface
- Renders data in a canonical XML-format. The classes
ViewObjectImpl
and
ViewRowImpl
implement this method to render
data in XML.
Use this method whenever data is required in XML format, either to present
a UI (after converting XML data into some HTTP format using a stylesheet) or
to pass the data as payload for messages via JMS.
The options parameter represents a set of bit flags that will
control the writeXML
behavior. The following bit flags have been defined:
- public static long XML_OPT_LIMIT_RANGE = 0x00000001 -
Controls whether writeXML will only write rows in the range.
If this flag is off, all rows in the row set will be written.
If this flag is on, only rows in the current range will be written.
- public static long XML_OPT_CHANGES_ONLY = 0x00000002 -
Controls whether only changed attribute values of an entity row is written.
If this is on, only the attributes whose value has been marked as
"changed" will be written.
If this is off, all attributes (regardless of whether the attribute
value
has been changed or not) will be written.
This flag is relevant only when writing
EntityImpl
.
The voAttrMap parameter
represents in a hashmap, the mapping between a given ViewObject's definition
type and the corresponding Attributes/accessors to render. A null entry
in the hashmap means, render all attributes and accessors of that viewobject type.
- Specified by:
writeXML
in interface XMLInterface
- Following copied from interface:
oracle.jbo.XMLInterface
- Parameters:
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.
writeXML
public Node writeXML(int depthCount,
long options)
- Description copied from interface:
XMLInterface
- Renders data in a canonical XML-format. The classes
ViewObjectImpl
and
ViewRowImpl
implement this method to render
data in XML.
Use this method whenever data is required in XML format, either to present
a UI (after converting XML data into some HTTP format using a stylesheet) or
to pass the data as payload for messages via JMS.
The depthcount parameter
represents to what level the rendering should recurse. A depthcount of
zero (0) means do not traverse any View Links while rendering. One (1) means
traverse the View Links on this object but no View Links thereafter, and
so on.
The options parameter represents a set of bit flags that will
control the writeXML
behavior. The following bit flags have been defined:
- public static long XML_OPT_LIMIT_RANGE = 0x00000001 -
Controls whether writeXML will only write rows in the range.
If this flag is off, all rows in the row set will be written.
If this flag is on, only rows in the current range will be written.
- public static long XML_OPT_CHANGES_ONLY = 0x00000002 -
Controls whether only changed attribute values of an entity row is written.
If this is on, only the attributes whose value has been marked as
"changed" will be written.
If this is off, all attributes (regardless of whether the attribute
value
has been changed or not) will be written.
This flag is relevant only when writing
EntityImpl
.
- Specified by:
writeXML
in interface XMLInterface
- Following copied from interface:
oracle.jbo.XMLInterface
- Parameters:
depthCount
- represents to what level the rendering should recurse.options
- a set of bit flags that will control the writeXML
behavior.
writeXML
public Node writeXML(long options,
com.sun.java.util.collections.HashMap map,
XSLStylesheet xslt)
- Specified by:
writeXML
in interface XMLInterface
writeXML
public Node writeXML(int depthCount,
long options,
XSLStylesheet xslt)
- Specified by:
writeXML
in interface XMLInterface
readXML
public void readXML(Element elem,
int depthCount,
XSLStylesheet xslt)
- Specified by:
readXML
in interface XMLInterface
readXML
public void readXML(Element elem,
int depthCount)
- Specified by:
readXML
in interface XMLInterface