Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Changing the behavior of remove() method

727171Dec 21 2009 — edited Dec 22 2009
Hello,

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
This post has been answered by 522734 on Dec 21 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 19 2010
Added on Dec 21 2009
4 comments
1,139 views