Hibernate、MySQL 视图和 hibernate.hbm2ddl.auto = 验证
我可以在 Hibernate 中使用 MySQL 视图,将它们视为表 - 即。该实体与为表创建的实体没有什么不同。但是,当 Hibernate 设置为验证模型时,我的应用程序将不会部署,因为它找不到视图,因为它假设它是一个表。
是否可以在启用部署时间验证的情况下使用 Hibernate 实体(hibernate.hbm2ddl.auto = validate)?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JIRA 中有几个与此相关的问题 (
HHH-2018、HHH-1872 和HHH-1329)所以这显然可能是新的。我的理解是,目前最简单的解决方法是关闭 hbm2ddl。如果您认为现有问题未涵盖您的案例(例如,因为您正在使用 MySQL),也许可以打开一个新问题。There are several issues in JIRA about this (
HHH-2018, HHH-1872, andHHH-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.