如何将复合键与 Castle ActiveRecord 一起使用

发布于 2024-08-07 01:03:09 字数 174 浏览 4 评论 0原文

我读到这是为了使用 Castle ActiveRecord 映射一个类 该类必须有一个主键(代理键或复合键)。

现在,假设我有一个只想用于阅读的表格 并且该表没有代理键或自然组合键。

有什么方法可以仍然进行一些手动 Guid(或其他 id)生成 使映射类成为可能?

同样,该表仅用于阅读目的。

I read that in order to map a class using Castle ActiveRecord
the class must have a primary key (surrogate or composite).

Now, suppose I have a table which I only want to use for reading
and the table doesn't have surrogate key or natural composite key.

Is there any way to be able to still have some manual Guid (or other id) generation
to make it possible to map the class?

Again, the table is used ONLY for reading purposes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱殇璃 2024-08-14 01:03:09

这里有一个关于带有复合键的 Castle Active Record 的很好的描述:

Active Records主键

注意,不建议使用复合键。

如果没有键,您打算如何从表中选择行?

There is a good description of Castle Active Record with Composite Key here:

Active Records Primary Keys

Note using composite key is not recommended.

How do you plan to select rows from your table if you have no key?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文