Manus에서 모든 스킬 실행
원클릭으로
원클릭으로
원클릭으로 Manus에서 모든 스킬 실행
시작하기$pwd:
spring-data-jpa-repo-creator
// Creates Spring Data JPA repositories following best practices.
$ git log --oneline --stat
stars:47
forks:6
updated:2026년 1월 3일 07:40
SKILL.md
// Creates Spring Data JPA repositories following best practices.
Creates JPA entities following best practices.
Creates Spring REST APIs following best practices.
Creates Spring Service classes following best practices.
Creates recommended package structure for Spring Boot projects.
| name | spring-data-jpa-repo-creator |
| description | Creates Spring Data JPA repositories following best practices. |
The following are key principles to follow while creating Spring Data JPA Repositories:
@Query with JPQL for custom queriesFile: 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 support to automatically populate createdAt and updatedAt fields.
@CreatedDate and @LastModifiedDate annotations to your BaseEntity class.@EntityListeners(AuditingEntityListener.class) to your BaseEntity class.@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 {
}