entity-mapper-expert

Community

Design JPA entities and mappers with Long FK strategy.

Authorryu-qqq
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill standardizes JPA Entity and EntityMapper creation, enforcing a "Long FK" strategy to decouple entities, prohibiting JPA relationship annotations, and ensuring clean separation between Domain and Persistence layers. It automates the setup of robust, maintainable data models.

Core Features & Use Cases

  • Long FK Strategy: Mandates the use of Long foreign keys and strictly forbids JPA relationship annotations (@ManyToOne, @OneToMany, etc.) to simplify entity graphs and prevent N+1 issues.
  • Strict Entity Structure: Guides the creation of entities with protected default constructors, private all-fields constructors, and public static of() factory methods, along with Getter-only access for immutability.
  • Bidirectional Mapper Generation: Creates @Component mappers responsible for accurate, bidirectional conversion between Domain aggregates and JPA entities (toEntity() and toDomain() methods).
  • Zero-Tolerance Rules: Prohibits Lombok, Setters, and direct new Entity() calls, promoting immutability, controlled object creation, and architectural integrity.
  • Use Case: When defining new JPA entities or refactoring existing ones, use this skill to generate the entity and its corresponding mapper. This ensures they adhere to strict architectural and coding conventions, saving development time and reducing future refactoring.

Quick Start

Generate a JPA Entity and its mapper for an 'Order' aggregate, applying the Long FK strategy and Getter-only access.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: entity-mapper-expert
Download link: https://github.com/ryu-qqq/AuthHub/archive/main.zip#entity-mapper-expert

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.