简体   繁体   English

使用 Quarkus 和 Panache,从外部库中指定要使用的实体

[英]With Quarkus and Panache, specify the entities to use from an external library

The project includes multiple micro services.该项目包括多个微服务。

All of my Panache entities are declared in their own project, and this project is included as a maven dependency in the other projects that need them.我所有的 Panache 实体都在他们自己的项目中声明,并且该项目作为 maven 依赖项包含在需要它们的其他项目中。 The reason they are centralised in an external library is because multiple project will use the same DB (most of them in read only).它们集中在外部库中的原因是因为多个项目将使用同一个数据库(其中大部分是只读的)。

My problem is that the lib contains all of the entities of all the projects.我的问题是 lib 包含所有项目的所有实体。 So any project that includes this library will create a DB containing all of the tables of all the declared entities.因此,任何包含该库的项目都将创建一个包含所有已声明实体的所有表的数据库。

How can I configure quarkus to choose which entity or which folder of entities to use instead of using every entity detected in the external lib?如何配置 quarkus 以选择要使用的实体或实体文件夹,而不是使用在外部库中检测到的每个实体?

Edit - What I have tried :编辑-我尝试过的

  • setting quarkus.hibernate-orm.packages=my.specific.entities.package in application.properties .application.properties中设置quarkus.hibernate-orm.packages=my.specific.entities.package Result: no effect结果:没有效果

It was a bug in Quarkus.这是 Quarkus 中的一个错误。 should be solved in v2.6: https://github.com/quarkusio/quarkus/issues/21682应该在 v2.6 中解决: https://github.com/quarkusio/quarkus/issues/21682

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM