在 Spring Boot 2.1.6.RELEASE 中,javax.persistence 是通过 JPA 依赖提供的,通常会与你的项目中的 Hibernate 依赖一起使用。你需要确保在 pom.xml 中包含了 JPA 相关的依赖。下面是如何配置的:

确保 pom.xml 中有 JPA 依赖,在你的 pom.xml 文件中,确保包含以下依赖(通常在 spring-boot-starter-data-jpa 中已经包含了 JPA 和 Hibernate):

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>


点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部