QueryDsl不会为git子模块的@Entity类生成q类。

huangapple go评论64阅读模式
英文:

QueryDsl does not generate q-classes for @Entity classes of git submodules

问题

我有一个带有 Git 子模块的 Java 项目(Spring Boot)。我已经将 QueryDsl 添加到了我的项目中,但它只为主项目的 @Entity 类生成 q-类,而不是子模块的 @Entity 类。

我应该怎么解决这个问题?

附注:Spring Data 的功能良好,所有 @Entity 类都可以使用。

英文:

I have a java project (spring boot) with git submodules. I've added QueryDsl to my project but it generates q-classes only for @Entity classes of main project, not for @Entity classes of submodules.

What should I do to fix it?

p.s. Spring Data works well, all @Entity classes are available to use.

答案1

得分: 2

将一个名为 package-info.java 的文件添加到您自己的项目中,该文件引用了子项目中的类,并在 @QueryEntities 中进行了声明:

@QueryEntities({
        BlobEntity.class
})
package com.pallasathenagroup.querydsl;

import com.blazebit.persistence.testsuite.entity.BlobEntity;
import com.querydsl.core.annotations.QueryEntities;
英文:

Add a package-info.java file to your own project, that references the classes from the child project in @QueryEntities:

@QueryEntities({
        BlobEntity.class
})
package com.pallasathenagroup.querydsl;

import com.blazebit.persistence.testsuite.entity.BlobEntity;
import com.querydsl.core.annotations.QueryEntities;

</details>



huangapple
  • 本文由 发表于 2020年5月29日 22:52:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/62088745.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定