Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Spring Boot中配置Hibernate以忽略某些通过依赖项导入的带有实体标记的类_Hibernate_Spring Boot_Kotlin_Spring Webflux - Fatal编程技术网

在Spring Boot中配置Hibernate以忽略某些通过依赖项导入的带有实体标记的类

在Spring Boot中配置Hibernate以忽略某些通过依赖项导入的带有实体标记的类,hibernate,spring-boot,kotlin,spring-webflux,Hibernate,Spring Boot,Kotlin,Spring Webflux,在我的项目中,我使用了springbootstarterdatajpa和springbootstarterwebflux 我有各种各样的 @实体符号由hibernate正确识别,但是,在一个模块中,我依赖于项目中与Web服务器无关的另一个模块,其结构如下所示: ROOT MODULE / \ Dependency Dependant (non web app) (web app with spring boot jpa) 这个非web模块还

在我的项目中,我使用了
springbootstarterdatajpa
springbootstarterwebflux

我有各种各样的 @实体符号由hibernate正确识别,但是,在一个模块中,我依赖于项目中与Web服务器无关的另一个模块,其结构如下所示:

       ROOT MODULE
       /         \
  Dependency   Dependant
 (non web app) (web app with spring boot jpa)
这个非web模块还使用hibernate和@Entity。 在启动spring服务器时,web目录中的hibernate似乎试图加载另一个模块中标记为@Entity的类,这导致了奇怪的问题和数据泄漏


如何告诉hibernate只查看当前模块而忽略其他模块

您可以使用@EntityScan注释告诉spring在哪里可以找到您的实体。 有关和的更多详细信息