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

oracle.jbo
Interface RowSet

All Superinterfaces:
NavigatableRowIterator, Properties, RowIterator, RowSetIterator, XMLInterface
All Known Subinterfaces:
ViewObject, ViewObjectDynAttr, WSRowSet
All Known Implementing Classes:
ViewObjectImpl, ViewRowSetImpl, ViewUsageImpl, WSRowSetImpl, WSViewObjectImpl

public interface RowSet
extends RowSetIterator, Properties, XMLInterface

RowSet belongs to a View Object. It manages a collection of View rows. One or more Row Set Iterators may be open on the Row Set to enumerate through the rows. Row Set Iterator adds the concept of currency (current row) on top of a Row Set's collection of rows.

A View Object may have one or more of Row Sets. At the same time, a View Object is a Row Set itself. Internally, for each View Object, the default Row Set is created through which the View Object can function as a Row Set. Other Row Sets that are not the default Row Set are referred to as secondary Row Sets.

Whereas a View Object manages the query statement, a Row Set manages query bind parameter values. Hence, a query statement may contain bind variables ('?' for JDBC style and :1, :2, ... for Oracle style) and multiple Row Sets may be created with different bind variable values.

For example (using Oracle style binding), given the query statement

    SELECT ... FROM EMP WHERE DEPTNO = :1
 
A Row Set may be opened with a bind value of 10. Such a Row Set will contain Employee rows of Department 10. Another Row Set may create opened through ViewObject@createRowSet(String) with a bind value of 20, which would represent Employees of Department 20.

Since:
JDeveloper 3.0
See Also:
ViewObject, RowSetIterator

Field Summary
static byte FORWARD_ONLY
           
static byte RANGE_PAGING
           
static byte RANGE_PAGING_AUTO_POST
           
static byte 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
 
Method Summary
 void closeRowSet()
          Closes the Row Set.
 RowSetIterator createRowSetIterator(java.lang.String name)
          Creates an iterator for the Row Set.
 void executeQuery()
          Executes the View Object's query.
 RowSetIterator findRowSetIterator(java.lang.String rsiName)
          Gets the named Row Set Iterator that was created at runtime for this Row Set.
 byte getAccessMode()
           
 ApplicationModule getApplicationModule()
          Gets the Row Set's Application Module that contains this Row Set.
 long getEstimatedRowCount()
          Counts the number of rows in the collection defined by the View Object's query.
 RowSetIterator[] getMasterRowSetIterators()
          Return all controlling masters of this Row Set.
 java.lang.String getName()
          Gets the Row Set's name.
 RowSetIterator[] getRowSetIterators()
          Gets all Row Set Iterators that belong to this Row Set.
 ViewObject getViewObject()
          Gets the View Object that contains this Row Set.
 java.lang.Object[] getWhereClauseParams()
          Gets the bind variable values to be used with the View Object's where-clause.
 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 isMaxFetchSizeExceeded()
          Tests if the query result has been fetched to the end and the end was reached due to hitting the maxFetchSize limit
 boolean removeMasterRowSetIterator(RowSetIterator masterRSI)
          Removes a master Row Set Iterator.
 void setAccessMode(byte mode)
          Constrains the row access based on the following settings:
 void setAssociationConsistent(boolean consistent)
          Sets the association-consistent flag for this Row Set.
 void setForwardOnly(boolean forwardOnly)
          Constrains the Row Set to sequential access.
 boolean setMasterRowSetIterator(RowSetIterator masterRSI)
          Sets the master iterator.
 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.
 
Methods inherited from interface oracle.jbo.RowSetIterator
addManagementListener, closeRowSetIterator, createDetailRowSet, getDetailRowSets, getEstimatedRangePageCount, getFilteredRows, getFilteredRowsInRange, getNextRangeSet, getPreviousRangeSet, getRowSet, getSyncLock, isNameGenerated, removeManagementListener, scrollToRangePage
 
Methods inherited from interface oracle.jbo.NavigatableRowIterator
addListener, removeListener
 
Methods inherited from interface oracle.jbo.RowIterator
createAndInitRow, createKey, createRow, enumerateRowsInRange, findByEntity, findByKey, first, getAllRowsInRange, getCurrentRow, getCurrentRowIndex, getCurrentRowSlot, getFetchedRowCount, getIterMode, getRangeIndexOf, getRangeSize, getRangeStart, getRow, getRowAtRangeIndex, getRowCount, getRowCountInRange, hasNext, hasPrevious, insertRow, insertRowAtRangeIndex, isRangeAtBottom, isRangeAtTop, isRowValidation, last, next, previous, removeCurrentRow, removeCurrentRowAndRetain, removeCurrentRowFromCollection, reset, scrollRange, scrollRangeTo, setCurrentRow, setCurrentRowAtRangeIndex, setIterMode, setRangeSize, setRangeStart, setRowValidation
 
Methods inherited from interface oracle.jbo.Properties
getProperties, getProperty, refreshProperty
 
Methods inherited from interface oracle.jbo.XMLInterface
readXML, readXML, writeXML, writeXML, writeXML, writeXML
 

Field Detail

SCROLLABLE

public static final byte SCROLLABLE
See Also:
Constant Field Values

FORWARD_ONLY

public static final byte FORWARD_ONLY
See Also:
Constant Field Values

RANGE_PAGING

public static final byte RANGE_PAGING
See Also:
Constant Field Values

RANGE_PAGING_AUTO_POST

public static final byte RANGE_PAGING_AUTO_POST
See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Gets the Row Set's name.

Specified by:
getName in interface RowSetIterator
Returns:
the name of the Row Set.

setMasterRowSetIterator

public boolean setMasterRowSetIterator(RowSetIterator masterRSI)
Sets the master iterator.

Parameters:
masterRSI - a master Row Set Iterator.
Returns:
true if the operation succeeded.

getViewObject

public ViewObject getViewObject()
Gets the View Object that contains this Row Set.

If this Row Set is the result of calling a View Link accessor, the returned View Object is an internal View Object. See ViewObject.isInternal().

Returns:
the parent View Object.

setWhereClauseParams

public void setWhereClauseParams(java.lang.Object[] values)
Specifies the bind variable values to use with the View Object's where-clause.

Setting the where-clause bind values through this method does not automatically execute the query. You must call executeQuery() to apply the new bind values.

Parameters:
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.

setWhereClauseParam

public void setWhereClauseParam(int index,
                                java.lang.Object value)
Specifies a single bind variable value to use with the View Object's where-clause.

Setting the where-clause bind values through this method does not automatically execute the query. You must call executeQuery() to apply the new bind values.

Parameters:
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.

getWhereClauseParams

public java.lang.Object[] getWhereClauseParams()
Gets the bind variable values to be used with the View Object's where-clause.

Returns:
an array of bind-variable values.

executeQuery

public void executeQuery()
Executes the View Object's query.


isExecuted

public boolean isExecuted()
Returns true if the current ViewObject's query has been executed for this Row Set.

Returns:
true if query has been executed.

createRowSetIterator

public RowSetIterator createRowSetIterator(java.lang.String name)
Creates an iterator for the Row Set.

Parameters:
name - the name to be given to the iterator.
Returns:
an iterator for this.

getRowSetIterators

public RowSetIterator[] getRowSetIterators()
Gets all Row Set Iterators that belong to this Row Set.

Returns:
the array of Row Set Iterators.

findRowSetIterator

public RowSetIterator findRowSetIterator(java.lang.String rsiName)
Gets the named Row Set Iterator that was created at runtime for this Row Set.

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.

removeMasterRowSetIterator

public boolean removeMasterRowSetIterator(RowSetIterator masterRSI)
Removes a master Row Set Iterator.

Returns:
true if masterRS was found, false otherwise.

getMasterRowSetIterators

public RowSetIterator[] getMasterRowSetIterators()
Return all controlling masters of this Row Set.

Returns:
An array of master iterators.

getApplicationModule

public ApplicationModule getApplicationModule()
Gets the Row Set's Application Module that contains this Row Set.

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 ViewObject.isInternal()). 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.

Returns:
the ApplicationModule to which this Row Set belongs.

getEstimatedRowCount

public long getEstimatedRowCount()
Counts the number of rows in the collection defined by the View Object's query.

This number may fluxuate when the View Object is syncronized with its Entity Object.

Returns:
the number of rows.

isForwardOnly

public boolean isForwardOnly()
Tests if the Row Set is constrained to sequential access.

Returns:
true if the Row Set is restricted to forward-only processing.
See Also:
setForwardOnly(boolean)

setForwardOnly

public void setForwardOnly(boolean forwardOnly)
Constrains the Row Set to sequential access.

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.

Parameters:
forwardOnly - true restricts the Row Set to forward-only processing, false otherwise.

getAccessMode

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

setAccessMode

public void setAccessMode(byte mode)
Constrains the row access based on the following settings:

Switching access modes for a rowset will not take effect until the next explicit call to executeQuery. Switching accessmode back to SCROLLABLE from any other mode is not allowed.

Parameters:
mode - One of the four enumerated values SCROLLABLE, FORWARD_ONLY, RANGE_PAGING, RANGE_PAGING_AUTO_POST

setAssociationConsistent

public void setAssociationConsistent(boolean consistent)
Sets the association-consistent flag for this Row Set.

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.


isAssociationConsistent

public boolean isAssociationConsistent()
Tests if association-consistent mode is on.

Returns:
true if un-posted changes are visible, false otherwise.
See Also:
setAssociationConsistent(boolean)

closeRowSet

public void closeRowSet()
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.


isFetchComplete

public boolean isFetchComplete()
Tests if the query result set has been fetched to the end.

Returns:
true if the result set has been fetched to the end.

isMaxFetchSizeExceeded

public boolean isMaxFetchSizeExceeded()
Tests if the query result has been fetched to the end and the end was reached due to hitting the maxFetchSize limit

Returns:
true if the result set has been fetched to the maxFetchSize limit and there are still more rows in the database.

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

 

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