如何使用jpa和mongo查询DSL配置

kuhbmx9i  于 2021-08-25  发布在  Java
关注(0)|答案(0)|浏览(286)
pom.xml
<dependency>
  <groupId>com.querydsl</groupId>
  <artifactId>querydsl-jpa</artifactId>
  <version>${querydsl.version}</version>
</dependency>

<dependency>
  <groupId>com.querydsl</groupId>
  <artifactId>querydsl-mongodb</artifactId>
  <version>${querydsl.version}</version>
</dependency>

<dependency>
  <groupId>com.querydsl</groupId>
  <artifactId>querydsl-apt</artifactId>
  <version>${querydsl.version}</version>
  <scope>provided</scope>
  <exclusions>
    <exclusion>
      <artifactId>javassist</artifactId>
      <groupId>org.javassist</groupId>
    </exclusion>
  </exclusions>
</dependency>

...

<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
  <execution>
    <goals>
      <goal>process</goal>
    </goals>
    <configuration>
      <outputDirectory>target/generated-sources/java</outputDirectory>
      <processors>
        <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
        <processor>org.springframework.data.mongodb.repository.support.MongoAnnotationProcessor</processor>
      </processors>
    </configuration>
  </execution>
</executions>

当maven清理并编译时

Attempt to recreate a file for type  .....
error: cannot find symbol
import com.......entity.QA...;
                                       ^
  symbol:   class QA....
  location: package com.......

但是当编译完成时

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

并成功创建了qclass。
如何清除“错误:找不到符号”
当我尝试执行处理器时,它是相同的。
如何将jpa querydsl与mongo querydsl配置为同一项目?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题