我试图根据以下内容生成数据库模式:
https://stackoverflow.com/a/17844417/9608756
但是eclipse不识别EnversSchemaGenerator类。这个类没有自动导入,在我的jars中看不到它。
这是脚本:
Configuration config = new Configuration();
config.setProperty("hibernate.dialect","org.hibernate.dialect.H2Dialect");
config.addAnnotatedClass(MyClass.class);
SchemaExport export = new EnversSchemaGenerator(config).export(); // ERROR!这是pom.xml:
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.3.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.4.3.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-envers -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>5.4.3.Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>发布于 2019-07-15 09:42:55
您试图使用的示例基于Hibernate的旧版本。EnversSchemaGenerator类已从Hibernate源中删除(发出HHH-11461)。
您可以使用SchemaExport类,如用Hibernate 5编程生成数据库模式中提到的那样。
https://stackoverflow.com/questions/57036192
复制相似问题