Getting Soft Deletetions into reactor

1 view
Skip to first unread message

Mark Drew

unread,
Dec 10, 2008, 6:45:28 AM12/10/08
to reacto...@googlegroups.com, reacto...@googlegroups.com
Whilst I have been looking and developing the code to make columns
invisible I have been thinking about the ability to "soft" delete
items in your database.

What is a soft delete? Essentially you are setting a property of a
column to say that that row is not visible anymore, so instead of :

DELETE FROM User WHERE userid = 1234

You would do:

UPDATE User SET bDelete = true WHERE userid = 1234

So. That is a kinda syntax right there, but I am thinking on how you
would use this? i.e. in the reactor file? adding a softdelete()
method?

Some things I have been bouncing round my head are to define a column
that is a boolean and doing something like this

<object name="User">
<field name="bDelete" deletevalue="true" ignore="true" />
</object>

i.e. you wouldn't see the bDelete field, it would have a deletevalue
and thus most of your queries would have to have:

AND bDELETE <> "true" (or whatever)

I would like your ideas on this... as I am thinking it might have
fairly wide ranging implications (all the selects should ignore items
that are soft deleted right?)


(| am off to see how this works with Hibernate... might get some *inspiration*)
Mark Drew

Adobe Community Expert
Reactor ORM Project Manager
Blog: http://www.markdrew.co.uk/blog/
LinkedIn: http://www.linkedin.com/in/mdrew

Doug Hughes

unread,
Dec 10, 2008, 7:19:08 AM12/10/08
to reacto...@googlegroups.com, reacto...@googlegroups.com
An idea would be to specify which column indicates the record is deleted in the reactor xml file and what value indicates it's deleted it's non-standard.  From there automatically ignore it and use it when reading records to filter out items where that column is the deleted value.

So you could use this as an example:

<object name="foo" deleted="bar" />

If the bar value were 1 it'd be deleted.

Thanks,

Doug Hughes, President
Alagad Inc.
dhu...@alagad.com
888 Alagad4 (x300)
Office: 919-550-0755
Fax: 888-248-7836
Reply all
Reply to author
Forward
0 new messages