Command Palette

Search for a command to run...

Назад к скиллам
скилл № 17155

spring-data-jpa-repo-creator

Creates Spring Data JPA repositories following best practices.

БесплатноБез исполняемых скриптов
sivaprasadreddyот sivaprasadreddy★ 46 звёзд на GitHub20 установок в других каталогах

Установить spring-data-jpa-repo-creator в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Spring Data JPA Repository Creator

Instructions

The following are key principles to follow while creating Spring Data JPA Repositories:

  • Make sure to create the recommended package structure for Spring Boot projects
  • Create repositories only for aggregate roots
  • Use @Query with JPQL for custom queries
  • Prefer meaningful method names over long Spring Data JPA finder methods
  • Use constructor expressions or Projections for read operations
  • Use default methods for convenience operations

Example: EventRepository

File: events/domain/EventRepository.java

interface EventRepository extends JpaRepository<EventEntity, EventId> {

    @Query("""
            SELECT e FROM EventEntity e
            WHERE e.startDatetime > :now
            ORDER BY e.startDatetime ASC
            """)
    List<EventEntity> findUpcomingEvents(@Param("now") Instant now);

    @Query("""
            SELECT e FROM EventEntity e
            WHERE e.code = :code
            """)
    Optional<EventEntity> findByCode(@Param("code") EventCode code);

    // Convenience methods using default interface methods
    default EventEntity getByCode(EventCode eventCode) {
        return this.findByCode(eventCode)
                .orElseThrow(() -> new ResourceNotFoundException("Event not found with code: " + eventCode));
    }
}

Enable JPA Auditing

Enable JPA Auditing support to automatically populate createdAt and updatedAt fields.

  • Add @CreatedDate and @LastModifiedDate annotations to your BaseEntity class.
  • Add @EntityListeners(AuditingEntityListener.class) to your BaseEntity class.
  • Create a Spring @Configuration class and add @EnableJpaAuditing annotation.
package dev.sivalabs.meetup4j.shared;

import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.Instant;

@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseEntity {

    @Column(name = "created_at", nullable = false, updatable = false)
    @CreatedDate
    protected Instant createdAt;

    @Column(name = "updated_at", nullable = false)
    @LastModifiedDate
    protected Instant updatedAt;

    // Getters and setters
}

Enable JPA Auditing in your application configuration:

@Configuration
@EnableJpaAuditing
public class JpaConfig {
}
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл spring-data-jpa-repo-creator?

Creates Spring Data JPA repositories following best practices.

Как установить скилл spring-data-jpa-repo-creator?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл spring-data-jpa-repo-creator запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить spring-data-jpa-repo-creator с