Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Hibernate 在 Spring MVC 中做项目,我正在使用 MySQL DB。在我的数据库中,我已经创建了一个视图,我想使用休眠调用该视图。
所以我在这里引用了这篇文章作为答案,你会看到"<class name="SomeThing" table="some_thing"/>",
"<class name="SomeThing" table="some_thing"/>"
类名Something是一个java类,它的属性是数据库视图中的列,对吗?
Something
我需要<property>在映射中添加映射的其他部分吗?
<property>
您必须使用与其他实体类相同的 View 类。您也可以使用注释、属性、映射和其他关系。在我的项目中,我们使用了相同的但 db 是 PostgreSQL。那没关系。