Closed spring-projects-issues closed 11 years ago
Mark Serrano commented
By the way, the reason why I have the following code is because the fields will come from JSON. The "username" name here is just a sample field
PathBuilder<User> entityPath = new PathBuilder<User>(User.class, "user");
StringPath path = entityPath.get(new StringPath("username"));
BooleanExpression hasUsername = path.eq(username);
Oliver Drotbohm commented
We're currently building against Querydsl 2.2.0. Is there a chance you try running your code against that version? It seems there we're some breaking API changes that require recompilation against the newer version from our side. I'll consider this ticket as a general "upgrade to 2.2.3"
Oliver Drotbohm commented
Fixed and deployed to both 1.1.x and 1.0.x branch
Mark Serrano commented
Thanks for the quick action. I pulled the latest snapshot, and my app worked. I'm no longer getting java.lang.NoSuchMethodError. My test suite are now all green.
I believe the problem has been resolved
Mark Serrano opened DATAJPA-115 and commented
I have a Jpa repository that utilizes QueryDSL's fluent API:
Then I have a service that reads records from the repository via the findAll() method. I have a requirement that the fields must be dynamic and the records are pageable:
However an exception is thrown whenever that method is called:
I tried digging into the code and the source and I can't find the reasons why. The internal implementation doesn't show any missing methods. I have checked my jars but I didn't find any old dependencies. I tested my project both at home and at work (Ubuntu, Windows, proxied, non-proxied environments). But I keep getting the same exception.
When I check the following:
As a workaround, I did the following code:
And it works perfectly. I tried to match as possible the original Spring JPA implementation. I don't really know what's wrong with the findAll() method, but directly calling the EntityManagerFactory somehow did the trick.
I have attached a strip-down version of my webapp. It's a Maven project with unit tests included. Just run Maven test to verify the error.
You need to have MySQL and create a db "testdb". No data is needed but you can prepopulate them. There's a data.sql inside the classpath. (I'm trying to initialize the db with jdbc:initialize-database but it keeps throwing an error. You might wanna take a peek of that error if you like).
By the way my Maven properties:
Thanks.
Affects: 1.0.1, 1.1 M1
Attachments:
Referenced from: commits https://github.com/spring-projects/spring-data-jpa/commit/02558854de16908a1db0c72edc653064dc57b123, https://github.com/spring-projects/spring-data-jpa/commit/6059ff40fe8f164c1fde7b0ab8afbbd9ee4f5271