spring-data-jpa

Create Spring Data JPA entities, repositories, and custom queries for Spring Boot.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/gazolla/gazapps-java-skills --skill spring-data-jpa-gazolla
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-data-jpa
Source: https://github.com/gazolla/gazapps-java-skills/tree/main/spring-data-jpa
Command: npx skills add https://github.com/gazolla/gazapps-java-skills --skill spring-data-jpa-gazolla

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Spring Data JPA patterns provide a proven, reusable approach to building data access layers in Spring Boot applications, covering entities, repositories, queries, relationships, and auditing to reduce boilerplate and promote consistency.

Core Features & Use Cases

  • Entity modeling and base patterns (BaseEntity, common annotations, validations)
  • Repository patterns for standard CRUD and query methods
  • Custom JPQL and native queries with pagination and projections
  • Relationship mappings with lazy loading and fetch strategies
  • Auditing support for created/updated timestamps
  • Practical examples for PostgreSQL and other relational databases
  • N+1 avoidance techniques using JOIN FETCH and EntityGraph

Quick Start

Create your entity and repository, wire a DataSource, and run your Spring Boot application to validate Spring Data JPA patterns.

Frequently Asked Questions about spring-data-jpa

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

FAQPage Schema
How do I avoid N+1 queries in Spring Data JPA when fetching related entities?

Avoid N+1 queries in Spring Data JPA by applying JOIN FETCH in JPQL queries or using EntityGraph to specify eager fetching strategies for related entities, reducing redundant database calls.

What is the best way to set up auditing for created and updated timestamps in Spring Boot?

Set up auditing in Spring Boot by applying auditing annotations to entity fields, enabling automatic tracking of created and updated timestamps for robust data access pattern consistency.

How do I write custom JPQL and native queries with pagination in Spring Data repositories?

Write custom JPQL and native queries with pagination in Spring Data repositories using query methods and projections, handling complex data retrieval across relational databases like PostgreSQL.

Does Spring Data JPA work with PostgreSQL for entity modeling and relationship mappings?

Spring Data JPA works with PostgreSQL for entity modeling, supporting relationship mappings with lazy loading and fetch strategies to ensure robust and consistent data access.

When should I use JOIN FETCH versus EntityGraph for lazy loading in Spring Data JPA?

Use JOIN FETCH for simple query-level eager loading or EntityGraph for declarative fetch strategies, both preventing N+1 queries and optimizing lazy loading in Spring Data JPA applications.