Home

Querydsl Reference Documentation

Type-safe SQL-like queries for Java.

Get Started with JPA View on GitHub


Querydsl is a framework that enables the construction of statically typed SQL-like queries for multiple backends in Java. Instead of writing queries as inline strings or externalizing them into XML files, you construct them via a fluent API.

Benefits

  • Code completion in your IDE — discover available columns and operations as you type.
  • Syntactically valid queries — the compiler catches most query mistakes before runtime.
  • Safe domain references — properties are referenced through generated types, not strings.
  • Refactoring friendly — rename a field and every query that uses it updates automatically.

Supported Backends

Quick Example

QCustomer customer = QCustomer.customer;
List<Customer> bobs = queryFactory.selectFrom(customer)
    .where(customer.firstName.eq("Bob"))
    .orderBy(customer.lastName.asc())
    .fetch();

Current Version

The latest release is 7.1. Add it to your Maven project:

<dependency>
  <groupId>io.github.openfeign.querydsl</groupId>
  <artifactId>querydsl-jpa</artifactId>
  <version>7.1</version>
</dependency>

See the Migration Guide if you are upgrading from the original com.querydsl artifacts.