Querydsl is a framework which enables the construction of statically typed SQL-like queries. Instead of writing queries as inline strings or externalizing them into XML files they can be constructed via a fluent API like Querydsl.

The benefits of using a fluent API in comparison to simple strings are for example

  1. code completion in IDE

  2. almost none syntactically invalid queries allowed

  3. domain types and properties can be referenced safely

  4. adopts better to refactoring changes in domain types