且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

QueryDsl错误。没有生成Q类

更新时间:2022-05-30 02:37:11

在您的来源中,您没有导入生成的类,例如:

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.