Académique Documents
Professionnel Documents
Culture Documents
Its always recommended to call super.<method> to let ADF do its job,before custo
m code gets executed.Unless one handles logic completely on one's own.
EntityImpl
protected void prepareForDML(int i, TransactionEvent transactionEvent) {
Method calls doDML at the end.
protected void doDML(int i, TransactionEvent transactionEvent) {}
Does the DML operation. This is where everything gets into the DB.All the INSERT
, UPDATE, and DELETE statements run here!
public void beforeCommit(TransactionEvent transactionEvent) {}
Invoked before commit is called. By this time the changes are already present in
the DB.So any logic that needs updated data in the DB can be writtern here.
public void afterCommit(TransactionEvent transactionEvent) {}
Similar to above method.
protected void validateEntity() {}
Call executes the entity level validations defined on the EO.Gets invoked when u
se moves from one row to another.
public void lock() {}
Executes a SELECT FOR UPDATE based on the DML operations, for eg like UPDATE or
DELETE
protected void create(AttributeList attributeList) {}
Apart from declarative defaulting override the method to have custom creation an
d defaulting logic for attributes.
public void remove() {}
Self explanatory
public void postChanges(TransactionEvent transactionEvent) {}
Calls prepareForDML and later doDML to post the changes to DB.Its only after the
method's execution data changes are available in the DB before being committed.
If apps need some PL/SQL or any procedure to be invoked with updated data they
can do it here after super or in doDML as needed.
public boolean isAttributeUpdateable(int i) {}
Returns true if the attribute is updateable. Override the method to define own l
ogic, to whether an attribute is updateable or not apart from default WHILE_NEW,
NEVER or ALWAYS.The super.isAttributeUpdateable returns the declarative setting
.
Eg: Lets say Commision is updateable only when Salary is greater than 5000.This
cannot be declaratively achieved. One can write that logic here.
<PseudoCode>
if(index==COMM)
return this.getSal()!=null && this.getSal().doubleValue()>5000
else
return super.isAttributeUpdateable(index) //Default setting for the rest
protected void setAttributeInternal(int p1, java.lang.Object p2) { }
Triggers attribute level validations. One can see that every attribute setter ha
s setAttributeInternal; It's because of this call the attribute level validation
s get fired.
protected void populateAttribute(int i, Object object) {}
Use it to set attribute value by skipping any attribute level validations. The d
efault setAttribute fires validation after value is set and does not update the
target value if any validation fails.
protected void populateAttributeAsChanged(int i, Object object) {}
Same as above but instructs ADF that the attributes value has changed.
ViewObjectImpl
protected ViewRowImpl createRowFromResultSet(Object object,ResultSet resultSet)
{}
Executed after the VO SQL query runs.Its here the query result set is iterated a