如何在某些实体中禁用Hibernate的模式验证? [英] How to disable schema validation in Hibernate for certain entities?

查看:147
本文介绍了如何在某些实体中禁用Hibernate的模式验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何禁用某些实体的 Hibernate 中的模式验证(并非全部)?我的一些实体正在使用导致验证失败的SQL,所以我想禁用它们的验证。 解决方案

不确定哪个版本你正在使用的hibernate,但它可以使用:hibernate.hbm2ddl.schema_filter_provider property

Hibernate配置



用于指定org.hibernate .tool.schema.spi.SchemaFilterProvider用于在数据库模式上创建,删除,迁移和​​验证操作。 SchemaFilterProvider提供的过滤器可用于将这些操作的范围限制为特定的命名空间,表和序列。所有对象都包含在defau


How do I disable schema validation in Hibernate for certain entities (not all)? Some of my entities are using SQL which lead to fail validation so I want to disable validation for them.

解决方案

not sure which version of hibernate you are using, but it can be done using: hibernate.hbm2ddl.schema_filter_provider property

Hibernate Configuration

Used to specify the org.hibernate.tool.schema.spi.SchemaFilterProvider to be used by create, drop, migrate, and validate operations on the database schema. SchemaFilterProvider provides filters that can be used to limit the scope of these operations to specific namespaces, tables and sequences. All objects are included by defau

这篇关于如何在某些实体中禁用Hibernate的模式验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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