Monday, April 21, 2014

ADF VO Methods

clearCache

Clears the View Object cache. This method can be called for resource conservation. Calling this method also forces an automatic reexecution of the query for all RowSets, which refreshes the cache from the database.

reset

Resets the iterator. This method delegates to the default RowSetIterator. The iterator is positioned to the slot before the first row, the state of a newly-executed row set.

createRow

Creates a new view row. The new row is not placed in the entity cache until its primary key is initialized. It is inserted into the database when changes are posted to database and the transaction is committed.
Note that the constituent entities will be added to the entity-cache if the primary key of these entites are populated/set when the relevant entity's create() method is called. PrimaryKey attributes of Bc4J generated ID types (like RowID, DBSequence, etc) are defaulted before Entity.create and thus entities with such types as Primary Key attribute will be placed in the entity cache during create.

notifyRowInserted

This method is invoked by the framework when inserts are made to the given ViewRowSet for this ViewObject. This method can be overridden to perform calculations in a subclass or to cache a list of new rows for some other reason.

notifyRowDeleted

This method is invoked by the framework when a row is deleted from the given ViewRowSet for this ViewObject. This method can be overridden to perform calculations in a subclass or to cache a list of deleted rows for some other reason.

notifyRowUpdated

This method is invoked by the framework when updates are made to any attribute for rows in the given ViewRowSet for this ViewObject. This method can be overridden to perform calculations in a subclass if a particular attribute changes. Also, if the sub-class wants to block event-propogation to some/all rowsets of this viewobject, this method could be used to perform such filtering.

AccessMode

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

writeXML

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.

Source: http://docs.oracle.com/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#createRow__
Related Posts Plugin for WordPress, Blogger...