如何处理 querydsl 多个模式具有相同的 table 名称?

How to deal wiith querydsl multiple schema have same table name?

只是我在尝试访问具有多个模式的查询 DSL 时遇到了问题,我添加了多个模式如下

<schemaPattern>ABC,DEF</schemaPattern>

我的 table 名字模式是

<tableNamePattern>PQR,STU</tableNamePattern>

假设两个模式都有 DEF table 那么当我编译 Maven 项目时它会给我以下错误。

Failed to execute goal com.querydsl:querydsl-maven-plugin:4.2.1:export (default) on project TestProject:
Execution default of goal com.querydsl:querydsl-maven-plugin:4.2.1:export failed: Attempted to write multiple times to D:\test\repos\testProject\target\generated-sources\testPackage\domain\dependency\QDEF.java, please check your configuration

任何人都可以告诉我解决这个问题的方法并且还可以解释如何在特定模式中访问生成的 类(例如我想声明 QDEF qdet = QDEF.qdef ,这是正常的方式, 但如何在 STU 架构中声明 QDEF)?

我相信这已经解决了 here。看起来 <schemaToPackage>true</schemaToPackage> 是你需要的。