2
  1. I am trying to use the following method while using com.mysema.query package.

    QueryDslRepositorySupport.getQuerydsl().applyPagination(pageable, query);

However, When I pass com.mysema.query.jpa.JPQLQuery object to the method, it complains that it needs com.querydsl.jpa.JPQLQuery object.

Why does it do that? I am not using com.querydsl package in my project. And so, it should be able to work fine with com.mysema.query package and ideally the query parameter should be an object of type com.mysema.query.jpa.JPQLQuery

  1. What can I do without changing my package in the project?

Or is it advisable to use both the packages in a springboot project?

  1. What really is the difference between these two other than the ownership of the packages by Mysema and Querydsl?

  2. Another issue I am facing after moving from com.mysema.querydsl to com.querydsl - This method gives me a compile time error -

    jpaQuery.from(qClass1, qClass2, qClass3)

My Qclasses are of EntityPathBase type, where as the from() method of com.querydsl.JPAQuery expects EntityPath classes.

I regenerated my QClasses with the following plugin but the QClasses still extend EntityPathBase, and not EntityPath (an interface)

<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>
    </plugin>
Righto
  • 855
  • 3
  • 11
  • 32
  • Possible duplicate of [The difference between com.mysema.query and com.querydsl?](http://stackoverflow.com/questions/32469814/the-difference-between-com-mysema-query-and-com-querydsl) – Marc Tarin Feb 28 '17 at 08:49
  • http://stackoverflow.com/questions/32469814/the-difference-between-com-mysema-query-and-com-querydsl – Marc Tarin Feb 28 '17 at 08:50
  • Agreed, just that I had some additional questions and was hoping an expert would answer. – Righto Feb 28 '17 at 09:02
  • The [spring boot dependencies](https://github.com/spring-projects/spring-boot/blob/master/spring-boot-dependencies/pom.xml) uses querydsl 4 (currently 4.1.4) so I would advise to stick to the com.querydsl packages. AFAIK the API didn't change that much between release 3.* and 4.*, so switching to it shouldn't take long, and it may prevent you from having other mistakes in later releases of spring boot. – Marc Tarin Feb 28 '17 at 09:47
  • I see. However, I saw that the most recent packages have replaced the list method with fetch. The list method used to take in qClass parameters. However, fetch methods do not take any such parameter. I tried using the version 3.6.8, which has the list() method but maven was not able to download it. – Righto Feb 28 '17 at 10:19

0 Answers0