Databases Reference
In-Depth Information
Advanced topics on entity objects
In the earlier chapters, we saw the basic features of enity objects and learned how to use
them for our web applicaion. In this chapter, we will see some advanced features of the
enity object, which is more powerful in building a robust and scalable ADF web applicaion.
Tuning
The Use Update Batching checkbox in the Tuning secion of an enity object's Overview
tab is used to update the underlying tables for the enity object, and to use a statement
that has minimal queries for the INSERT , DELETE , and UPDATE operaions. One bulk
CRUD statement is used for transacions involving independent statements. When this
opion is checked, you will have to provide a value in the When Number of Eniies to
Modify Exceeds: box. The default opion is 1 , which will enable update batching when
the number of eniies exceed one.
The Retain Associaion Accessor Rowset opion in the Tuning secion is used to retain
the associaion accessor when the enity is involved in retrieving the rowset from the
associaion accessor. When this property is not checked, a new rowset is created
whenever the enity retrieves informaion using the associaion accessor.
Enabling this opion will reduce addiional query execuions because the creaion of
rowsets will happen only for the irst ime, and the same rowset is accessed the next
ime. Programmaically, you will use the setAssociationAccessorRetained()
method to set the value in your EntityCollImpl class.
If we need to iterate through the rowset programmaically, we use the following code:
RowSet rs = (RowSet)getAccounts();
rs.reset();
while (rs.hasNext()) {
AccountImpl r = (AccountImpl)rs.next();
//do custom logic
}
 
Search WWH ::




Custom Search