Mysema Querydsl: No JPAQuery # list () Method

Some online examples of using Mysema Querydsl rely on the JPAQuery#list() method, for example. https://stackoverflow.com/a/16626832/how-to-setup-statement-android-statement-in-javascript/2326135#5116193 It is also mentioned in official documentation .

However, I do not see this method in the JPAQuery class. It does not appear in the IDE autocomplete and is not present in the JAR file downloaded by Maven.

I added these dependencies to my Maven project:

 <dependency> <groupId>com.querydsl</groupId> <artifactId>querydsl-apt</artifactId> <version>4.0.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.querydsl</groupId> <artifactId>querydsl-jpa</artifactId> <version>4.0.4</version> </dependency> 

Why is the JPAQuery#list() method missing?

+5
source share
1 answer

The JPAQuery.list method was removed when Querydsl was updated from 3.x to 4.x. Since you are using version 4.0.4, this method is no longer available.

As I understand it, after reading the release notes , version 4 introduces many significant changes to the code base, which violates the old code. You have two options:

  • go to the latest version of line 3.x, which is 3.6.8 and use the list method
  • save version 4.0.4 and use fetch instead. Take a look at this GitHub issue for a list of changes.
+3
source

Source: https://habr.com/ru/post/1233610/


All Articles