Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
joaquimscosta avatar

Spring Boot Data Ddd

  • 1 installs
  • 21 repo stars
  • Updated August 5, 2026
  • joaquimscosta/arkhe-claude-plugins

Implements the Spring Boot 4 data layer for DDD using Spring Data JPA or JDBC aggregates, repositories, projections, and N+1 prevention.

About

Implements DDD tactical patterns in Spring Boot 4 with Spring Data JPA and JDBC, covering aggregate roots, value objects, repositories, and EntityGraph N+1 prevention. A developer uses it when building the persistence layer of a DDD Spring Boot app.

  • JPA vs JDBC selection guidance for DDD
  • AbstractAggregateRoot, projections, JSpecify null-safety

Spring Boot Data Ddd by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #79 of 89 Java & JVM skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/joaquimscosta/arkhe-claude-plugins --skill spring-boot-data-ddd

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars21
Last updatedAugust 5, 2026
Repositoryjoaquimscosta/arkhe-claude-plugins

What it does

Implements the Spring Boot 4 data layer for DDD using Spring Data JPA or JDBC aggregates, repositories, projections, and N+1 prevention.

Files

SKILL.mdMarkdownGitHub ↗

Spring Boot Data Layer for DDD

Implements DDD tactical patterns with Spring Data JPA and Spring Data JDBC in Spring Boot 4.

Technology Selection

ChooseWhen
Spring Data JPAComplex queries, existing Hibernate expertise, need lazy loading
Spring Data JDBCDDD-first design, simpler mapping, aggregate-per-table, no lazy loading

Spring Data JDBC enforces aggregate boundaries naturally—recommended for new DDD projects.

Core Workflow

1. Define aggregate root → 2. Map value objects → 3. Create repository → 4. Implement service layer → 5. Add projections

See WORKFLOW.md for detailed step-by-step instructions with code examples.

Quick Patterns

See EXAMPLES.md for complete working examples including:

  • Aggregate Root with AbstractAggregateRoot and domain events (Java + Kotlin)
  • Repository with EntityGraph for N+1 prevention
  • Transactional Service with proper boundaries
  • Value Objects (Strongly-typed IDs, Money pattern)
  • Projections for efficient read operations
  • Auditing with automatic timestamps

Spring Boot 4 Specifics

  • JSpecify null-safety: @NullMarked and @Nullable annotations
  • AOT Repository Compilation: Enabled by default for faster startup
  • Jakarta EE 11: All imports use jakarta.* namespace
  • ListCrudRepository: New interface returning List<T> instead of Iterable<T>

ListCrudRepository (Spring Data 3.1+)

New repository interface returning List<T> for better API ergonomics:

// OLD: CrudRepository returns Iterable<T>
public interface UserRepository extends CrudRepository<User, Long> {
    Iterable<User> findAll();  // Requires conversion to List
}

// NEW: ListCrudRepository returns List<T>
public interface UserRepository extends ListCrudRepository<User, Long> {
    List<User> findAll();  // Direct List return
    List<User> findAllById(Iterable<Long> ids);  // Also List
}

// Can also extend both for full functionality
public interface UserRepository extends
    ListCrudRepository<User, Long>,
    ListPagingAndSortingRepository<User, Long> {
}

Benefits: No more StreamSupport.stream(iterable.spliterator(), false).toList() conversions.

Detailed References

  • Workflow: See WORKFLOW.md for detailed step-by-step data layer implementation
  • Examples: See EXAMPLES.md for complete working code examples
  • Troubleshooting: See TROUBLESHOOTING.md for common issues and Boot 4 migration
  • Aggregates & Entities: See references/AGGREGATES.md for complete patterns with value objects, typed IDs, auditing
  • Repositories & Queries: See references/REPOSITORIES.md for custom queries, projections, specifications
  • Transactions: See references/TRANSACTIONS.md for propagation, isolation, cross-aggregate consistency

Related Skills

NeedSkill
DDD concepts and designdomain-driven-design
REST API for aggregatesspring-boot-web-api
Module boundariesspring-boot-modulith
Repository testingspring-boot-testing

Anti-Pattern Checklist

Anti-PatternFix
FetchType.EAGER on associationsUse LAZY + @EntityGraph when needed
Returning entities from controllersConvert to DTOs in service layer
@Transactional on private methodsUse public methods (proxy limitation)
Missing readOnly = true on queriesAdd for read operations (performance)
Direct aggregate-to-aggregate referencesReference by ID only
Multiple aggregates in one transactionUse domain events for eventual consistency

Critical Reminders

1. One aggregate per transaction — Cross-aggregate changes via domain events 2. Repository per aggregate root — Never for child entities 3. Value objects are immutable — No setters, return new instances 4. Flush before events — Call repository.save() before events dispatch 5. Test with `@DataJpaTest` — Use TestEntityManager for setup

Related skills

Java & JVMbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.