ORM继承 [英] ORM Inheritance

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

问题描述

是否有任何真正希望并在ORM工具上使用继承支持,如果是,您认为哪一个提供最佳支持?

Has anyone really wanted and used inheritance support on ORM tools, and if yes which one do you think offers the best support?

或者ORM继承是天空中的馅饼概念吗?

Or is ORM Inheritance a "pie in the sky" concept?

推荐答案

我非常喜欢这个问题。我已经使用ORM工具(Toplink,现在是eclipselink,Hibernate)一段时间,我一直认为这是JPA文档中引用的,但我从来没有真正需要它。基本上我的理念是ORM只是为了阻止你编写tedius代码来提取数据库的记录。这确实是一个巨大的节省时间,它可以防止你犯下愚蠢的错误。当然你可以用这个做一些奇特的东西,但为什么不把它保存到控制器(如果你跟随MVC)而不是把它粘在模型中?

I like this question a lot. I've used ORM tools (Toplink, now eclipselink, Hibernate) for a while and I've always seen this as referenced in JPA documents but I've never really had a need for it. Basically my philosophy is the ORM is just there to prevent you from writing tedius code to pull out records for the database. That really is the huge timesaver and it prevents you from making stupid mistakes. Sure you can do fancy stuff with this, but why not save it for the controller (if you're following MVC) than stick it in the model?

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

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