I try to configure QueryDSL in Play Framework (with Java) but without success. I've searched for similar problems in Google and this is what I found:
1. QueryDSL and Play. But this post establishing the equivalence with Lombok and the solution does not work for me.
2. Emulating MAVEN process. This is what I really need to apply it to other similar modules, but does not show an example of how.
3. Configure multiple modules. In this case includes several modules and is a bit confusing.
So, how I could configure QueryDSL in Play? Anybody could include an example of how to do?
Thanks in advance.
I just got it working using play-querydsl with Play 2.2.2. I followed the instructions (using 0.1.1 as the version number in plugins.sbt instead of 0.1.0) and it generated the Q* model classes to
target/scala-2.10/src_managed/main/querydsl
. I use Eclipse, so I ranplay eclipse
to include this folder in the classpath.I tried to get the APT annotation compiling to work directly in Eclipse but gave up on that.
As a side note, I compared QueryDSL and EasyCriteria and I found EasyCriteria easier to use because it more closely mirrors the user-friendly queries of Ebean. However, if you want type safety, QueryDSL is definitely better than JPA's built-in criteria API.
plugins.sbt (Play 2.2.2):
build.sbt (Play 2.2.2):