-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
area/quarkiverseThis issue/PR is part of the Quarkiverse organizationThis issue/PR is part of the Quarkiverse organizationkind/extension-proposalDiscuss and Propose new extensionsDiscuss and Propose new extensions
Description
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
- Eduardo Ramírez eramirez@redhat.com
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/quarkiverseThis issue/PR is part of the Quarkiverse organizationThis issue/PR is part of the Quarkiverse organizationkind/extension-proposalDiscuss and Propose new extensionsDiscuss and Propose new extensions