sivaprasadreddy/sivalabs-marketplace/spring-data-jpa-repo-creator

Claude Code and agent skill by sivaprasadreddy/sivalabs-marketplace

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Creates Spring Data JPA repositories following best practices.

Install

npx vskill@latest install sivaprasadreddy/sivalabs-marketplace/spring-data-jpa-repo-creator

SKILL.md

The same SKILL.md was published earlier as majiayu000/claude-skill-registry-data/spring-data-jpa-repo-creator.

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

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.
java
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:

java
@Configuration
@EnableJpaAuditing
public class JpaConfig {
}

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sivaprasadreddy/sivalabs-marketplace/spring-data-jpa-repo-creator/badge)](https://verified-skill.com/skills/sivaprasadreddy/sivalabs-marketplace/spring-data-jpa-repo-creator)

Something wrong with this skill or its page? Tell us.