Skip to content

[Extension Proposal] Quarkus Qubit #52570

@ebramirez

Description

@ebramirez

Description

Qubit transforms lambda expressions into JPA Criteria Queries at build time for Panache entities:

  • Type-safe: Full IDE support with compile-time verification
  • Zero overhead: Queries are pre-compiled, not interpreted at runtime
  • Fluent API: JINQ-inspired method chaining for readable queries

This allows you to write queries like this for the Active Record pattern:

@Entity
public class Person extends QubitEntity {
    public String firstName;
    public int age;
    public boolean active;
}

List<Person> adults = Person.where((Person p) -> p.age >= 18).toList();

Or if you prefer, you can use the Repository Pattern:

@ApplicationScoped
public class PersonRepository implements QubitRepository<Person, Long> {
}

@Inject PersonRepository personRepository;

// Filtering
List<Person> adults = personRepository.where(p -> p.age >= 18).toList();

// Projection to DTO
List<PersonDTO> dtos = personRepository
    .where(p -> p.active)
    .select(p -> new PersonDTO(p.firstName, p.lastName))
    .toList();

// Aggregation
Double avgSalary = personRepository.avg(p -> p.salary).getSingleResult();

If interested in this extension, please +1 via the emoji/reaction feature of GitHub (top right).

Repository name

quarkus-qubit

Short description

A Quarkus extension that enables type-safe, lambda-based queries on Panache entities with build-time transformation to JPA Criteria Queries.

Repository Homepage URL

https://docs.quarkiverse.io/quarkus-qubit/dev/

Repository Topics

  • quarkus-extension
  • database
  • lambdas
  • queries
  • jpa
  • panache

Team Members

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/quarkiverseThis issue/PR is part of the Quarkiverse organizationkind/extension-proposalDiscuss and Propose new extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions