jpa-spring-data-kotlin-mapper

Validate Kotlin JPA entities and repositories for Spring Data and Hibernate correctness.

4|Updated Jun 10, 2026
One-click install
npx skills add https://github.com/mymx2/foreman --skill jpa-spring-data-kotlin-mapper-mymx2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jpa-spring-data-kotlin-mapper
Source: https://github.com/mymx2/foreman/tree/main/.qoder/skills.collected/skills/jpa-spring-data-kotlin-mapper
Command: npx skills add https://github.com/mymx2/foreman --skill jpa-spring-data-kotlin-mapper-mymx2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves common friction points in Kotlin-based Spring Data JPA projects, preventing subtle bugs related to lazy loading, entity identity, and performance bottlenecks that often plague Kotlin ORM implementations.

Core Features & Use Cases

  • Entity Design Validation: Ensures entity classes follow correct JPA semantics while avoiding common Kotlin pitfalls like improper data class usage.
  • Performance Optimization: Diagnoses and provides solutions for N+1 query issues, fetch plan inefficiencies, and transactional boundary problems.
  • Use Case: Use this skill when you are designing a new domain entity or debugging a LazyInitializationException to ensure your persistence layer is both performant and architecturally sound.

Quick Start

Use the jpa-spring-data-kotlin-mapper skill to review my current entity definitions and repository queries for potential N+1 performance issues and identity bugs.

Frequently Asked Questions about jpa-spring-data-kotlin-mapper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix LazyInitializationException in Kotlin Spring Data JPA projects?

Fix LazyInitializationException in Kotlin Spring Data JPA by reviewing transactional boundaries and fetch plans. This skill models persistence logic to ensure lazy associations are initialized within the correct transaction scope, preventing runtime errors and performance bottlenecks.

Why should I avoid using Kotlin data classes for JPA entity definitions?

Avoid Kotlin data classes for JPA entity definitions because their generated equals and hashCode methods destabilize entity identity in Hibernate. This skill enforces correct entity design to maintain stable identity semantics and prevent subtle ORM mapping bugs.

How do I resolve N+1 query performance issues in Spring Data JPA?

Resolve N+1 query issues in Spring Data JPA by diagnosing fetch plan inefficiencies and optimizing repository queries. This skill reviews entity relationships and persistence logic to eliminate unnecessary database calls and improve overall application performance.

What is the best way to manage JPA entity identity and equality in Kotlin?

Manage JPA entity identity and equality in Kotlin by enforcing stable identity semantics instead of relying on default data class behavior. This skill models correct entity design to ensure consistent equality checks across Hibernate persistence contexts and detached states.

Does this approach support reviewing existing Spring Data repository interfaces?

Yes, this approach supports reviewing existing Spring Data repository interfaces by diagnosing transactional boundary problems and relationship mapping inefficiencies. It models service-layer persistence logic to validate queries and optimize fetch plans for current domain entities.