Quarkus Queryable
Add annotation-driven filtering to collection endpoints generated by Hibernate ORM REST Data with Panache.
Queryable extends REST Data Panache with a query language for filtering collection results using entity annotations, Hibernate filters, and custom Criteria API predicates.
Keep your REST data layer concise: declare the fields and query behavior on your entities, then let Quarkus build the integration during augmentation.
Install the extension
Add Quarkus Queryable to your Maven application:
<dependency>
<groupId>io.quarkiverse.queryable</groupId>
<artifactId>quarkus-queryable</artifactId>
<version>4.0.4</version>
</dependency>
Then annotate your entities to expose filters on collection endpoints. The extension works with Hibernate ORM REST Data Panache; standard CRUD operations remain provided by REST Data.
See installation and a first entity or browse the extension source.
How Queryable builds queries
During Quarkus augmentation, Queryable emits REST resource and adapter bytecode
for each @QRs entity. At request time, the shared runtime reads the
entity's query annotations and builds the Criteria predicates. A single
collection endpoint handles the supported query annotations.
Declare the filters on the entity
@Entity
@QRs("/api/developers")
public class Developer extends PanacheEntity {
@QLike
public String name;
@Q
public LocalDate hiredOn;
}
The generated REST resource
This Java sketch shows what the generated resource bytecode does.
@Path("/api/developers")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class DeveloperQueryableResource extends QueryableGeneratedResource<Developer> {
public DeveloperQueryableResource() {
super(Developer.class);
}
@GET
public Response list(
@QueryParam("startRow") @DefaultValue("0") String startRow,
@QueryParam("pageSize") @DefaultValue("10") String pageSize,
@QueryParam("orderBy") String orderBy,
@Context UriInfo uriInfo) {
return listInternal(uriInfo);
}
}
From request parameters to Criteria predicates
GET /api/developers?like.name=ada&efrom.hiredOn=2025-01-01
The shared runtime contributes predicates equivalent to the following.
cb.like(
cb.lower(root.get("name")),
"%ada%"
);
cb.greaterThanOrEqualTo(
root.get("hiredOn"),
LocalDate.parse("2025-01-01")
);
The query combines these predicates with AND. Supported parameters
prefixed with or. form a separate cb.or(...) group,
which is combined with the other predicates using AND.
Part of Quarkiverse Hub
Quarkus Queryable is hosted by the Quarkiverse GitHub organization, which provides repository hosting—including build, CI, and release-publishing setup—for Quarkus extension projects contributed by the community.