# ADR-JPA-001 — The domain owns the persistence model - Status: Accepted - Date: 2026-08-11 - Design: §10.1, §23.3 ## Context A persistence platform can either own the repository abstraction — a `GenericRepository` every aggregate inherits — or provide only the pieces domains assemble themselves. ## Decision The domain owns entities, embeddables, repositories, queries, index requirements, and lock, soft-delete, and audit policy. The platform provides no generic CRUD repository and no base repository. `JpaRepositoryFragmentSupport` exists, has no `save`, `findById`, `findAll`, or `delete`, and is enforced not to acquire them. ## Consequences A generic base repository has one property that looks like a benefit and is not: every aggregate gets the same operations. That means each aggregate is offered operations that may be wrong for it — a `delete` on an append-only ledger, a `findAll` on a table that will never be small — and, worse, one aggregate's later requirement changes the shared base and therefore changes behaviour for aggregates nobody reviewed. Spring Data already implements CRUD. Re-implementing it adds a layer whose only function is to be harder to opt out of. The cost is a small amount of repetition: each domain declares the repository interface it needs. That repetition is the thing that makes each aggregate's persistence surface reviewable. ## Enforcement `JpaArchitectureRules.noGenericRepository()`; `JpaRepositoryFragmentSupportTest`.