Querydsl-jpa 3.7.3 error when used with spring -data-jpa 1.10.0

I use

<groupId>com.mysema.querydsl</groupId> <artifactId>querydsl-jpa</artifactId> <version>3.7.3</version> 

no problem with

 <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> <version>1.9.4.RELEASE</version> 

instead of this

 <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> <version>1.10.1.RELEASE</version> 

in the same code there are the following errors:

 [ERROR] /C:/Prj/Java/Eclipse/Elfolab/src/main/java/com/interlabsrl/elfolab/persistence/multiple/repository/elettroforesi/springdatajpa/LinguaRepository.java:[13,8] cannot access com.querydsl.core.types.OrderSpecifier class file for com.querydsl.core.types.OrderSpecifier not found [ERROR] /C:/Prj/Java/Eclipse/Elfolab/src/main/java/com/interlabsrl/elfolab/controller/ricercaPaziente/RicercaPazienteController.java:[487,33] cannot access com.querydsl.core.types.Predicate class file for com.querydsl.core.types.Predicate not found [ERROR] /C:/Prj/Java/Eclipse/Elfolab/src/main/java/com/interlabsrl/elfolab/controller/ricercaArchivio/RicercaArchivioController.java:[74,32] no suitable constructor found for QSort(com.mysema.query.types.OrderSpecifier<java.util.Date>) constructor org.springframework.data.querydsl.QSort.QSort(com.querydsl.core.types.OrderSpecifier<?>...) is not applicable (varargs mismatch; com.mysema.query.types.OrderSpecifier<java.util.Date> cannot be converted to com.querydsl.core.types.OrderSpecifier<?>) constructor org.springframework.data.querydsl.QSort.QSort(java.util.List<com.querydsl.core.types.OrderSpecifier<?>>) is not applicable (argument mismatch; com.mysema.query.types.OrderSpecifier<java.util.Date> cannot be converted to java.util.List<com.querydsl.core.types.OrderSpecifier<?>>) [ERROR] /C:/Prj/Java/Eclipse/Elfolab/src/main/java/com/interlabsrl/elfolab/controller/ricercaArchivio/RicercaArchivioController.java:[611,31] no suitable constructor found for QSort(com.mysema.query.types.OrderSpecifier<java.lang.String>) constructor org.springframework.data.querydsl.QSort.QSort(com.querydsl.core.types.OrderSpecifier<?>...) is not applicable (varargs mismatch; com.mysema.query.types.OrderSpecifier<java.lang.String> cannot be converted to com.querydsl.core.types.OrderSpecifier<?>) constructor org.springframework.data.querydsl.QSort.QSort(java.util.List<com.querydsl.core.types.OrderSpecifier<?>>) is not applicable (argument mismatch; com.mysema.query.types.OrderSpecifier<java.lang.String> cannot be converted to java.util.List<com.querydsl.core.types.OrderSpecifier<?>>) 

Any idea on what's wrong between these versions?

EDIT:

Using

  <dependency> <groupId>com.querydsl</groupId> <artifactId>querydsl-jpa</artifactId> <version>4.1.0</version> </dependency> 

I still have the following errors:

 C:\Prj\Java\Eclipse\Elfolab\src\main\java\com\interlabsrl\elfolab\persistence\multiple\repository\elettroforesi\table\custom\impl\MetodicaRepositoryImpl.java:11: error: package com.mysema.query.jpa.impl does not exist import com.mysema.query.jpa.impl.JPAQuery; 
+5
source share
3 answers

Instead

 <dependency> <groupId>com.mysema.querydsl</groupId> <artifactId>querydsl-*</artifactId> <version>3.7.3</version> </dependency> 

you should use now

 <dependency> <groupId>com.querydsl</groupId> <artifactId>querydsl-*</artifactId> <version>4.1.3</version> </dependency> 

The packages inside the jar files have also been changed, so you need to modify the imported querydsl classes in the source code.

+7
source

You must upgrade the version of your request to 4.1. Note that groupId has also changed.

In here you can see that 1.10.1.RELEASE uses 4.1 querydsl and may prevent you from using the old version.

+1
source

Use the following configuration (barely) here

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

and for the maven plugin

 <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/annotations</outputDirectory> <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor> </configuration> </execution> </executions> </plugin> 

Although most have been moved to com.querydsl, the plugin should currently be com.mysema.

0
source

All Articles