Changing the behavior of remove() method
727171Dec 21 2009 — edited Dec 22 2009Hello,
I am using ADFBC 11g.
I have overriden the remove() method in my Custom EntityImpl to implement update (is_deleted='Y') instead of real delete.. It is working good so far but i also want the "modified on" and "modified by" history columns to be updated after this operation. How can i make this happen? I could not find any setEntityState() method to manually mark the entity changed.
Here is my doDML method:
@Override
protected void doDML(int operation, TransactionEvent transactionEvent) {
int isDeletedColumn = getSoftDeleteColumn();
if (EntityImpl.DML_DELETE == operation && isDeletedColumn != -1) {
operation = DML_UPDATE;
}
if(EntityImpl.DML_INSERT == operation && isDeletedColumn != -1) {
setAttribute(isDeletedColumn, "N");
}
if(EntityImpl.DML_UPDATE == operation && isDeletedColumn != -1) {
if (null == getAttribute(isDeletedColumn))
setAttribute(isDeletedColumn, "N");
}
super.doDML(operation, transactionEvent);
}
Edited by: Deniz Gulmez on 21.Ara.2009 04:52