引入SpringBoot Jpa依赖后,项目出现警告

问题描述:

  SpringBoot项目引入Jpa依赖后项目出现警告:

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

WARN:spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning.

解决办法:

  在SpringBoot的配置文件中加入以下配置(加入后并不会对项目产生不好的影响):

spring.jpa.open-in-view=false

 

    原文作者:y_bccl27
    原文地址: https://blog.csdn.net/y_bccl27/article/details/100043465
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞