FluDa Data: Jakarta Data Repositories, Generated at Compile Time¶
FluDa Data is an implementation of Jakarta Data for Jakarta EE and CDI applications. You declare a @Repository interface, and an annotation processor generates the implementation at compile time — no runtime proxies, no classpath scanning, no reflection to read your entities. The generated code renders SQL and executes it through the FluDa JDBC Client.
The project is organized into three published modules:
| Module | Artifact | Description |
|---|---|---|
core |
fluda-data-core |
The runtime API: entity-model annotations (@Entity, @Identity, @AggregateRoot, @ValueObject, @Association), the generated-metadata contracts (EntityMetadata, AttributePathResolver), the SQL renderer (SqlBuilder) and its dialects, and paging/cursor support. |
qbn |
fluda-data-qbn |
The optional query-by-method-name parser. Add it to the annotation processor path for repositories that derive queries from method names (findBy…, countBy…, deleteBy…). |
processor |
fluda-data-processor |
The annotation processor. It reads each @Repository interface and emits the CDI implementation, entity metadata, reflection-free row mappers and the static metamodel. |
Key concepts¶
@Repository— the Jakarta Data stereotype. A repository interface extendsDataRepository,BasicRepositoryorCrudRepositorywith a concrete entity type, and the processor generates a matching…ImplCDI bean.- Compile-time generation — for every repository the processor emits the implementation plus a reflection-free
EntityMetadata, a row mapper and the_Entitystatic metamodel. Nothing is built or proxied at runtime. - JdbcClient execution — generated SQL is rendered by a dialect seam (identifier quoting and pagination) and run through
JdbcClient. The shipped dialects are H2 (the default) and PostgreSQL, selected with the-Afluda.dialectannotation-processing option. - Lifecycle annotations —
@Insert,@Update,@Saveand@Deletemap a method signature straight to a DML statement.save/saveAllare a true upsert, as Jakarta Data defines them. - Finders — three ways to express a query: built-in
CrudRepositorymethods, the Jakarta Data annotations (@Findwith@By/@OrderBy, or@Queryfor native SQL), and query-by-method-name (findByStatus, …) via the optionalqbnmodule.
Jakarta Data Query Language (JDQL) is not implemented
Methods annotated with @Query take native SQL supplied by your application. That SQL is not parsed or rewritten by the dialect layer, so it may be database-specific. JDQL string translation is out of scope.
Reading order¶
- Start with getting started to add the processor, map an entity, declare a repository and use the lifecycle annotations, built-in methods and query-by-method-name.
- Explore advanced topics for aggregate roots and value objects, and the roadmap for optimistic locking and domain events.