Hi I have a question about code generation when combining QueryDSL JPA and SQL. According to the answer of a SO question of the creator of QueryDQL, the combination of these two modules is a popular usage for CRUD manipulation(JPA) and queries(SQL).
After succeeding useing only JPA module, I tried to add SQL module but I dont know whether or not I should add the code generation of SQL to pom.
In fact I'm looking for insert function and I cannot find it at JPA module, that's why I'm trying to use SQL.
Also, when I tried to extends Spring Repository from QueryDslPredicateExecutor, there is an error :
The type com.mysema.query.types.Predicate cannot be resolved. It is indirectly referenced from required .class files.
Someone said it's Eclipse configuration issue but I dont get to solve the problem.
QueryDSL version is 4.1.2 and Spring Boot is 1.3.5. So what is the right version to use?
pom.xml
....
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-sql-spring</artifactId>
<version>${querydsl.version}</version>
</dependency>
....
<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.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
</dependency>
</dependencies>
</plugin>