Hibernate, MySQL Views and hibernate.hbm2ddl.auto = validate

混江龙づ霸主 提交于 2019-12-06 10:40:27

问题


I can use MySQL views in Hibernate by treating them like tables - ie. the entity is no different than one created for a table. However my application won't deploy when Hibernate is set to validate the model as it can't find the View as it assumes it's a table.

Is it possible to use Hibernate Entities with deploy time validation turned on (hibernate.hbm2ddl.auto = validate)?

Thanks.


回答1:


There are several issues in JIRA about this (HHH-2018, HHH-1872, and HHH-1329) so this might clearly be a new one. My understanding is that the easiest workaround for now is to turn hbm2ddl off. If you think that your case is not covered by the existing issues (e.g. because you are using MySQL), maybe open a new one.



来源:https://stackoverflow.com/questions/2019995/hibernate-mysql-views-and-hibernate-hbm2ddl-auto-validate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!