QueryDsl错误。没有生成Q类 [英] QueryDsl error. Q classes not generated
问题描述
我尝试生成查询类型类(例如 QUser
)但是出错...
I try to generate query type classes (e.g. QUser
) but got errors...
你可以在这里找到我的源代码: https://github.com/TheNakedMan/remindme.server/
You can find my source code here: https://github.com/TheNakedMan/remindme.server/
我正在使用IntelliJ IDEA,看起来我有工作插件。
请帮帮我。
I'am working with IntelliJ IDEA, and it seems like I have working plugin. Help me, please.
日志信息:
/ remindme.server / src / main / java / com / qoobico / remindme / server / repository / UserRepository.java
错误:(21,126)java:找不到符号符号:class QUser
/remindme.server/src/main/java/com/qoobico/remindme/server/repository/UserRepository.java Error:(21, 126) java: cannot find symbol symbol: class QUser
错误:(25,62)java:找不到符号符号:class QUser
location:interface
com.qoobico.remindme.server.repository.UserRepository
Error:(25, 62) java: cannot find symbol symbol: class QUser
location: interface
com.qoobico.remindme.server.repository.UserRepository
更新:
<$ c后$ c> LifeCycle->清理并在IntelliJ中运行 apt:process
,我有这样的错误:
After LifeCycle->clean
and run apt:process
in IntelliJ, I have this error:
[错误]无法在项目com.qoobico.remindme.server上执行目标:
无法解析项目
com.qoobico.remindme的依赖项。 server:com.qoobico.remindme.server:war:1.0-SNAPSHOT:
找不到工件
com.qoobico.remindme.server:com.qoobico.remindme.server:jar:1.0-SNAPSHOT
[ERROR] Failed to execute goal on project com.qoobico.remindme.server: Could not resolve dependencies for project com.qoobico.remindme.server:com.qoobico.remindme.server:war:1.0-SNAPSHOT: Could not find artifact com.qoobico.remindme.server:com.qoobico.remindme.server:jar:1.0-SNAPSHOT
推荐答案
在您的来源中,您没有导入生成的类,例如:
In your sources you did not import the generated classes, for instance:
import com.qoobico.remindme.server.entity.QUser;
如果要生成没有编译的类和/或安装包,请使用 maven目标 apt:process
。
If you want to generate the classes without compile and/or install the package use the maven goal apt:process
.
您可以使用IntelliJ启动这样的maven目标,使用 Maven Projects窗口。该窗口将显示所有可用目标。
You can use IntelliJ to start such a maven goal, use the Maven Projects window. The window will show you all available goals.
在命令行上你可以使用 mvn
cli,可以下载这里。
提示:来自帮助插件的命令 mvn help:describe -Dplugin = com.mysema.maven:apt-maven-plugin
将显示所有可用的apt-maven-plugin目标列表。
On the commandline you could use the mvn
cli, which can be downloaded here.
Hint: the command from the help plugin mvn help:describe -Dplugin=com.mysema.maven:apt-maven-plugin
will show you a list of all available apt-maven-plugin goals.
您将outputDirectory配置为: target / generated-sources / java
要让IDE找到该类,把它们放入你的课程路径。某些像IntelliJ这样的IDE会自动为maven项目执行此操作,因为该文件夹是默认文件夹。
You configured the outputDirectory to: target/generated-sources/java
To let your IDE find that classes, put them into your class path. Some IDEs like IntelliJ will do this automatically for maven projects, because that folder is the default.
这篇关于QueryDsl错误。没有生成Q类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!