能DataObjects.NET支持SQL标识列?标识、DataObjects、NET、SQL

由网友(噬魂)分享简介:虽然有很多喜欢约DataObjects.NET,我发现帮助资源是一个精干,并不能找到使用DataObjects.NET与关系数据库生成的主键的solit例子。这似乎就像D4O不会对SQL Server执行插入,除非它在密钥的控制研究。有没有人在野外解决了这个?解决方案 有没有简单的方法来DO4使用IDENTITY列...

虽然有很多喜欢约DataObjects.NET,我发现帮助资源是一个精干,并不能找到使用DataObjects.NET与关系数据库生成的主键的solit例子。这似乎就像D4O不会对SQL Server执行插入,除非它在密钥的控制研究。

有没有人在野外解决了这个?

解决方案

有没有简单的方法来DO4使用IDENTITY列 - 主要是因为它的设计要依靠批量密钥生成(又名高住低训算法)。

AFAIK,这里有没有好的解决方法。例如。 DO4支​​持自定义密钥生成器,但它是pretty的复杂来发展依靠IDENTITY列 - 事实上,它应该插入假记录散货,并进一步将其删除(或回滚事务)工作。考虑到有可能是具有唯一约束的列,这个任务变得pretty的复杂。

我们会考虑在未来实现这一点。

While there's lots to like about DataObjects.NET, I've found help resources to be a lean, and can't find a solit example of using DataObjects.NET with RDBMS generated primary keys. It would seem as though D4O won't do inserts against SQL Server unless it's in controll of the key.

什么是 Database SQL

Has anyone solved this in the wild?

解决方案

There is no easy way to make DO4 use IDENTITY columns - mainly, because it is designed to rely on bulk key generation (aka HiLo algorithm).

AFAIK, there are no good workarounds here. E.g. DO4 supports custom key generators, but it's pretty complex to develop one relying on IDENTITY column - in fact, it should insert fake records in bulks and remove them further (or rollback a transaction) to work. Taking into account there can be columns with unique constraints, the task becomes pretty complex.

We'll think about implementing this in future.

阅读全文

相关推荐

最新文章