Spring data Querydsl in eclipse not generating query type classes

こ雲淡風輕ζ 提交于 2019-12-21 20:57:54

问题


I don't see query dsl classes generated in eclipse added below dependency and plugin in the pom.xml. Can some please review below change required for query-dsl integration in spring boot?

<dependency>
    <groupId>com.mysema.querydsl</groupId>
    <artifactId>querydsl-apt</artifactId>
    <version>${querydsl.version}</version>
    <scope>provided</scope>
</dependency>

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

<!--Plugin for query-dsl -->
    <plugin>
        <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>
             <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
                </configuration>
            </execution>
        </executions>
    </plugin>

`


回答1:


In eclipse, sometimes you have to refresh your project multiple times to see the generated-sources. If not try to generate the files by

right click on your project -> run as -> maven generate sources.



回答2:


I followed below 2 steps after that Query dsl class stopped giving compilation error.

Enable annotation processing in eclipse. Add generated package in source in the classpath.



来源:https://stackoverflow.com/questions/49993994/spring-data-querydsl-in-eclipse-not-generating-query-type-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!