如何将复合键与 Castle ActiveRecord 一起使用
我读到这是为了使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有一个关于带有复合键的 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?