ADF EO - Assigning Database Sequence value to an Attribute at time of row creation.
Wednesday, April 09, 2008
Sometimes you need to assign a database sequence value to an attribute at entity row creation time. Override the create() method and use SequenceImpl helper class in the oracle.jbo.server package to get the sequence value.
Example:
import oracle.jbo.server.SequenceImpl;
protected void create(AttributeList nameValuePair) {
super.create(nameValuePair);
SequenceImpl sequence =
new SequenceImpl("EMPLOYEE_SEQ",getDBTransaction());
setEmpId(sequence.getSequenceNumber());
}