Skip to content
v3.2.0

AI Unified Process persistence layer - jOOQ repositories, projections, and repository tests

jooq-persistence

Builds the persistence layer of a use case (UC-XXX) with jOOQ: one @Repository per aggregate with an injected DSLContext, type-safe queries against the classes jOOQ generates from the Flyway migrations, projections into Java records with Records.mapping, MULTISET for nested collections, paging and dynamic filters, optimistic locking when the entity has a version, and UC-XXX BR-YYY markers on the query conditions that enforce a business rule. Transactions stay with the service layer. Hands the repository method signatures and record types to the service layer. Normally run by /use-case-implement after the migration layer; can be run directly. Use when the user asks to "write the jOOQ repository", "implement the data access for UC-001", "add a jOOQ query", "map the result into a record", "set up jOOQ code generation", or mentions jOOQ, DSLContext, Records.mapping, multiset, or a repository in a project that combines layer plugins.

jooq-persistence-test

Writes the persistence layer tests of a use case (UC-XXX) for jOOQ repositories: integration tests against a real database (Testcontainers PostgreSQL or the project's database) with @SpringBootTest or @JooqTest, test data from Flyway test migrations, expected values from the specification and the test data, classes named UC<id><Name>RepositoryTest and every method annotated @UseCase. Tests only queries with logic of their own — filters, joins, projections, MULTISET, paging, optimistic locking — not what the integration layer's tests already cover. /use-case-test runs it only to reconcile existing tests, for queries the integration layer cannot reach, or when the persistence layer is named; can be run directly. Use when the user asks to "test the jOOQ repository", "write repository tests for UC-001", "test this query against the database", or mentions jOOQ repository tests, @JooqTest, DSLContext tests, or Testcontainers tests of the data access in a project that combines layer plugins.