how to do logical delete filter flag for logical delete in the collection

Posts   
 
    
vsv
User
Posts: 17
Joined: 18-Sep-2007
# Posted on: 27-Sep-2007 01:48:12   

how to do logical delete filter flag for logical delete in the collection.

I am trying to setup logical delete. that is when user clicks delete button for a datagridview in winforms I want to flag this record as deleted. however, not physically delete from the collection, also because this is flagged as deleted i want it to be part of the dirtyEntities or a separate deletedEntities.

However, the deletedFlag is a column whose value could be mapped based on rules. ex: one will be deletedFlg another column to indicate deleted record could be inactiveDt column set to current time stamp. I want a way to specify generically in the entity.

any suggestions. is it possible to do such thing or related or any other better method. thanks vsv

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Sep-2007 11:10:27   

Hi vsv, this thread should be helpful for you: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=5809

David Elizondo | LLBLGen Support Team
vsv
User
Posts: 17
Joined: 18-Sep-2007
# Posted on: 27-Sep-2007 18:00:30   

LLBL gen than basically doesn't generate delete statements at all automatically, when does it generates delete statement while persisting?

may be the Impedence mismatch between database & Objects can't go away whatever methodology use<gr>. I am migrating from the Powerbuilder world & it does have two different methods: Delete (filtered to a delete buffer & delete statements are generated when persisted) & RowsMove(this one is same as Delete in LLBL & delete statement is not generated when persisted).

May be I am trying to understand how the bindings of collections happen with a bindingsource & hence with a datagridview(DGV).

If I get a filtered object list from a collection & bind it with DGV am I still referring to the instances in the collection or a new copy of the instances is made?

If I get another filtered object list from the same collection & bind it with another DGV does the first DGV content changes or what happens?

Basically I am trying to work around this problem of having to handle the delete in a different collection manually. If Insert, update & select can transfer into DML codes automatically, why not the delete?

I know this logical delete is an exception behavior that could be same as update in cases where somebody when updating should cause it as an insert statement instead where physical update & delete is not permitted in certain databases.

thanks vsv