1

我将我的休眠从 4.3 迁移到 5.1,但架构导出有一个例外。Hibernate 迁移指南提到了这一点,但没有提供解决方案。

我尝试使用元数据源,它对我有帮助。下面是在我的 HibernateUtils 中导致此问题的行。

   public static List createDBSchema() {

    Configuration cfg = getConfiguration();
    SchemaExport dbSchema = new SchemaExport(cfg);
    dbSchema.create(false, true);

    return dbSchema.getExceptions();
}

以下是在 cmd 中安装 mvn 后的错误消息。

HibernateUtils.java:[587,41] constructor SchemaExport in class org.hibernate.tool.hbm2ddl.SchemaExport cannot be applied to given types;
[ERROR]   required: no arguments
[ERROR]   found: org.hibernate.cfg.Configuration
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /C:/Development/Neon-Workspace/invitely_app/src/main/java/wadetech/DB/base/HibernateUtils.java:[588,33] incompatible types: boolean cannot be converted to java.util.EnumSet<org.hibernate.tool.schema.TargetType>
4

0 回答 0