Once you have retrieved a row (either by inserting it or navigating to it; see the related topics list for more information), you can change attribute values in the row. If the row contains persistent attributes, these will be changed in the entity cache and posted to the datasource when requested. For more information, see the related topics list.
You can change attribute values in one of two ways: call
setAttribute()
or use accessors.
Call setAttribute()
on the Row
, passing the
name of the attribute in as a String
and the value of the
attribute in as any Object
:
currentRow.setAttribute("OrderId", new Number(1));
Warning: If you use an incompatible Java type for the
value, you will get a ClassCastException
at runtime.
If you have exposed accessors for the view object, you can instead:
import orderentry.datamodel.common.*;
Row
to your custom view row interface (generally
the name of the view object definition, plus the word "Row" at the
end, e.g., OrdersViewRow
):
OrdersViewRow currentOrder = (OrdersViewRow) currentRow;
Note: You can also cast the Row
at the
same time you retrieve it.
setOrderId()
) , passing in the value of the attribute using its true
Java type (this will be checked at compile time):
currentOrder.setOrderId(new Number(1));
Ways to Manipulate Data
About Oracle ADF View Objects
About
Oracle ADF Entity Objects
About
Oracle ADF Business Components Cache Management
Posting Data Without Committing
Committing a Transaction
Ways to
Navigate Through Query Results
Inserting a Row
Retrieving
Attribute Values
Implementing
Business Logic
Copyright © 1997, 2004, Oracle. All rights reserved.