Why to use Querydsl?
- You can use code completion in IDE
- IDE refactoring tools work (more-or-less)
- compiler generates errors on compile time of wrong types etc vs Hibernate complains just on first run
- Consistency, you can use same principles to query JPA, MongoDB, Collections...
I would like to make a counterpoint to the QueryDSL usage.
I don't like to use QueryDSL for the follow reasons:
- You need to compile the project frequently to maintain the
- You need to setup the IDE to consider the
Qclasses generated on
targetas normal classes.
- I have already seen the IDE "get lost" and no longer recognize the
- I already create simple QueryDSL statements that generated really weird and not predictable SQLs.
Even being friendly for final users, I prefer to use JPQL because it's more closer to the generated SQL and more predictable.
But compared to Criteria, I prefer QueryDSL.