Doctrine 2 - 从数据库生成视图的实体 [英] Doctrine 2 - Generate entities with views from database
本文介绍了Doctrine 2 - 从数据库生成视图的实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以使用Doctrine 2从数据库生成视图?
It's possible to generate a view from database with Doctrine 2 ?
我解释:
包含一些我想要使用的视图,但我不知道如何生成这个视图?
My db contains some views i want use, but i don't know how generate this views ?
在我的例子中,我有两个表和一个视图,视图选择几个列在每个表中,我只想在项目的文件夹Entity中的此视图。
In my case, i have two tables and one view, the view select few column in each table and i just want THIS view in the folder "Entity" of the project.
非常感谢。
推荐答案
数据库视图不是 当前由Doctrine 2支持,但它可能执行的非常糟糕。尝试自己将视图映射为实体,并将其标记为@readOnly实体。
Database views are not currently supported by Doctrine 2, but it can potentially perform very badly. Try it yourself mapping the view as an entity and mark it as a @readOnly entity.
这篇关于Doctrine 2 - 从数据库生成视图的实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文