23917

ORM & Logical Delete

Do any of the available ORMs support using a bit field to represent row removal?

More information. Working in C#. I need to delete this way to support synchronization of remote database changes to a central database. I'm looking for a possible ORM, but am also interested in approaches to the problem. So if anyone knows any ORM in any language/environment that addresses this problem I would be interested in looking at it. Thanks for the questions feel free to ask more if anything is unclear.

Answer1:

This may not apply if you're not using .NET, but the LightSpeed ORM has a built in feature called "soft delete". Basically, when you have a DeletedOn field on your table LightSpeed will insert the time it was deleted. It automatically handles this on normal selects (e.g. where Deleted == null) so that the deleted items are not seen again. You could then write a sync process that detects the deleted state by checking that field.

You can of course instruct the querying engine to include deleted results.

Mindscape LightSpeed ORM

I am making an assumption also that we're talking about the same thing here :-)

Answer2:

I recommend to implement logical delete externally in your application, cause it's not very complex, but it will be more flexible. See this article for details.

Recommend

  • using react-with-style to style a react-dates component
  • How to get a TypeSafe URL to a static resource in Yesod
  • Add new accepted protocol to URL/link validation in SharePoint 2010
  • Merging Users in Kinvey
  • sending email using “bcc” without “to” in java application
  • DotNetOpenAuth - how to uniquely identify Google users?
  • Submission of new app with iAds
  • Get rendered html code in Backing Component from Composite Component
  • Group variable in cobol
  • R h2o.glm - issue with max_active_predictors
  • Ruby and class variables in inherit class
  • Insertion large number of Entities into SQL Server 2012 [duplicate]
  • How to skip require in ruby?
  • Most efficient way to move table rows from one table to another
  • Saving image to sd with current date and time in name doesn't work
  • NUnit 3.0 TestCase const custom object arguments
  • DIV instruction jumping to random location?
  • Sequential (transactional) API calls in angular 4 with state management
  • Reduction and collapse clauses in OMP have some confusing points
  • How can I speed up CURL tasks?
  • What does 'Language neutral' mean with regard to MAKELANGID?
  • Moving Android View and preventing onDraw to be called over and over again
  • Android activity accessing service's static reference before the service is ready
  • MongoDb aggregation
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • Yii2: Config params vs. const/define
  • Switching to Release Build causes runtime error in Web Reference
  • why overloaded new operator is calling constructor even I am using malloc inside overloading functio
  • How to delay loading a property with linq to sql external mapping?
  • How to get address from latitude and longitude android google map v2 [duplicate]
  • Get object from AWS S3 as a stream
  • JavaScriptCore crash on iOS9
  • Cross-Platform Protobuf Serialization
  • Javascript Callbacks with Object constructor
  • Validaiting emails with Net.Mail MailAddress
  • Can I have the cursor start on a particular column by default in jqgrid's edit mode?
  • Do I've to free mysql result after storing it?
  • 0x202A in filename: Why?
  • Matrix multiplication with MKL
  • WPF Applying a trigger on binding failure