Hibernate,MySQL视图和hibernate.hbm2ddl.auto =验证 [英] Hibernate, MySQL Views and hibernate.hbm2ddl.auto = validate

查看:123
本文介绍了Hibernate,MySQL视图和hibernate.hbm2ddl.auto =验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Hibernate中使用MySQL视图,方法是将它们视为表-即.该实体与为表创建的实体相同.但是,当将Hibernate设置为验证模型时,我的应用程序将不会部署,因为它假设它是表就找不到视图.

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.

是否可以在启用部署时间验证的情况下使用Hibernate实体(hibernate.hbm2ddl.auto = validate)?

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

谢谢.

推荐答案

JIRA中有一些与此有关的问题( HHH-1872 HHH -1329 ),因此显然这可能是新的.我的理解是,目前最简单的解决方法是关闭hbm2ddl.如果您认为您的案例不存在于现有问题中(例如,因为您使用的是MySQL),则可以打开一个新的案例.

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.

这篇关于Hibernate,MySQL视图和hibernate.hbm2ddl.auto =验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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