我想在 Wildfly 上使用 JPA 和 Spring。我试过这个配置:应用程序属性:spring.jmx.enabled=falsespring.datasource.jndi-name=java:/global/productionspring.datasource.driver-class-name=org.mariadb.jdbc.Driverspring.jpa.show-sql = truespring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialectspring.jpa.hibernate.ddl-auto = create-dropPOM文件: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.3.RELEASE</version> <relativePath /> </parent> <dependencies> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-jaxb-annotations</artifactId> <version>2.9.5</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.springframework.session</groupId> <artifactId>spring-session-core</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> </dependencies>但是当我尝试执行查询时,我得到:Caused by: org.hibernate.UnknownEntityTypeException: Unable to locate persister: org.rest.api.server.repository.Terminals10:28:27,539 ERROR [stderr] (default task-1) at org.hibernate.metamodel.internal.MetamodelImpl.locateEntityPersister(MetamodelImpl.java:642)配置实体的正确方法是什么?可能我需要手动映射它?
添加回答
举报
0/150
提交
取消