大规模 ORM 和继承
“大规模”微型 ORM 是否有处理继承的方法?
为 Massive 编写一个提供程序很难吗?
我需要一些与 SQL Server 非常接近的东西。作为第一步,最好拦截 Massive 生成的 SQL,然后将其推送到我选择的数据库中。
可能做这样的事情会产生所需的继承效果:
class Products:DynamicModel{...}
class BabyProducts : Products {...}
是否可以通过属性而不是通过继承将“产品”链接到动态模型?
注意这个项目(受 Massive 启发)可能更合适:http://www.toptensoftware.com/petapoco/
仍然不确定继承。
在提供程序上...仅扩展 IDbConnection 的 MicroORM,例如 http ://code.google.com/p/dapper-dot-net/ 可能是最好的起点。还不确定这对于 Massive 意味着什么。
Does the micro ORM "massive" have a way of handling inheritance?
Is it hard to write a provider for Massive?
I've got a need for something very close to SQL Server. As a first step, it'd be good to just intercept the SQL generated by Massive, and then push that into my database of choice.
Possibly doing something like this would have the desired inherited effect:
class Products:DynamicModel{...}
class BabyProducts : Products {...}
Is it possible to link "Products" to a dynamic model via an attribute instead of through inheritance?
N.B. this project (inspired by Massive) might be a closer fit: http://www.toptensoftware.com/petapoco/
still not sure about inheritance.
On providers... MicroORMs that only extend IDbConnection such as http://code.google.com/p/dapper-dot-net/ might the best place to start. Not sure what this means in terms of Massive yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我现在会选择 Dapper:
http://code.google.com/p/dapper-dot-net/source/browse/Tests/Tests.cs
Dapper 绝对是独立于数据库的并且它处理继承
搜索为了上面 Tests.cs 中的 TestInheritance() 为例。
I think I'm going to go with Dapper for now:
http://code.google.com/p/dapper-dot-net/source/browse/Tests/Tests.cs
Dapper is definitely database independent and it handles inheritance
Search for TestInheritance() in the Tests.cs above for an example.