6

I'm using

<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 using

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

on the same code I've 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 about 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 these 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;

3 Answers 3

7

Instead of

<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 also have been changed so you have to change imported querydsl classes in your source code.

2

You should update the version of your querydsl to 4.1. Note that the groupId also have changed.

In here you can see that the 1.10.1.RELEASE uses the 4.1 of querydsl and that could be interfering with you using an old version.

0
0

Use the following configuration found(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>

Even though the majority were moved to com.querydsl the plugin should currently still be com.mysema.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.