ORM&逻辑删除 [英] ORM & Logical Delete

查看:96
本文介绍了ORM&逻辑删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何可用的ORM是否支持使用位字段表示行删除?

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

更多信息.使用C#.我需要删除这种方式,以支持将远程数据库更改同步到中央数据库.我正在寻找可能的ORM,但也对解决问题的方法感兴趣.因此,如果任何人都知道可以解决此问题的任何语言/环境的任何ORM,我都会对它感兴趣.感谢您的问题,如果有任何不清楚的地方,随时问更多.

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.

推荐答案

如果您不使用.NET,则此方法可能不适用,但是LightSpeed ORM具有称为软删除"的内置功能.基本上,当您的表上有DeletedOn字段时,LightSpeed将插入其删除时间.它会在常规选择时自动处理此问题(例如,其中Deleted == null),这样就不会再显示已删除的项目.然后,您可以编写一个同步过程,通过检查该字段来检测已删除状态.

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 :-)

这篇关于ORM&逻辑删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆