Ne Zaman Aktifleştirmeli
JPA entity'leri ve tablo eşlemelerini tasarlarken
affaan-m/ECC
Spring Boot'ta entity tasarımı, ilişkiler, sorgu optimizasyonu, transaction'lar, auditing, indeksleme, sayfalama ve pooling için JPA/Hibernate kalıpları.
npx skills add https://github.com/affaan-m/ECC --skill "docs/tr/skills/jpa-patterns"Source checked Jul 28, 2026·Refresh due Oct 26, 2026
Reorganized from the pinned upstream SKILL.md
Spring Boot'ta veri modelleme, repository'ler ve performans ayarlaması için kullanın.
npx skills add https://github.com/affaan-m/ECC --skill "docs/tr/skills/jpa-patterns"The pinned source contains enough sections and task detail for a source-grounded deep guide; automated content is still not an independent test.
554 source words · 11 usable sections
Documentation workflow
Sections are extracted automatically from the pinned SKILL.md and link back to the source.
JPA entity'leri ve tablo eşlemelerini tasarlarken
Review the “Entity Tasarımı” section in the pinned source before continuing.
Varsayılan olarak lazy loading; gerektiğinde sorgularda JOIN FETCH kullan
Hafif sorgular için projections kullan:
Servis metodlarını @Transactional ile işaretle
SkillSignal prompt templates
These prompts were written by SkillSignal from the source structure; they are not upstream text.
Source-grounded prompt
Use for a documentation task while explicitly checking the source sections.
Use jpa-patterns for this documentation task: [task]. Inputs and constraints: [details]. Work through these pinned SKILL.md sections: “Ne Zaman Aktifleştirmeli”, “Entity Tasarımı”, “İlişkiler ve N+1 Önleme”, “Repository Kalıpları”, “Transaction'lar”. Cite the concrete requirements that shape each step, do not invent capabilities absent from the source, and verify the result against: [acceptance criteria].
Documentation checklist
The source section “Ne Zaman Aktifleştirmeli” has been checked.
The source section “Entity Tasarımı” has been checked.
The source section “İlişkiler ve N+1 Önleme” has been checked.
The source section “Repository Kalıpları” has been checked.
Choose a different workflow
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailJPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailPatrones JPA/Hibernate para diseño de entidades, relaciones, optimización de consultas, transacciones, auditoría, indexación, paginación y pooling en Spring Boot.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailFAQ
Spring Boot'ta veri modelleme, repository'ler ve performans ayarlaması için kullanın.
The source record exposes this install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/tr/skills/jpa-patterns". Inspect the command and pinned source before running it.
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
Patrones JPA/Hibernate para diseño de entidades, relaciones, optimización de consultas, transacciones, auditoría, indexación, paginación y pooling en Spring Boot.
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
Review jpa-patterns's use cases, installation, workflow, and original source instructions.
Spring Boot'ta veri modelleme, repository'ler ve performans ayarlaması için kullanın.
@Entity
@Table(name = "markets", indexes = {
@Index(name = "idx_markets_slug", columnList = "slug", unique = true)
})
@EntityListeners(AuditingEntityListener.class)
public class MarketEntity {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, length = 200)
private String name;
@Column(nullable = false, unique = true, length = 120)
private String slug;
@Enumerated(EnumType.STRING)
private MarketStatus status = MarketStatus.ACTIVE;
@CreatedDate private Instant createdAt;
@LastModifiedDate private Instant updatedAt;
}
Auditing'i etkinleştir:
@Configuration
@EnableJpaAuditing
class JpaConfig {}
@OneToMany(mappedBy = "market", cascade = CascadeType.ALL, orphanRemoval = true)
private List<PositionEntity> positions = new ArrayList<>();
JOIN FETCH kullanEAGER kullanmaktan kaçın; okuma yolları için DTO projections kullan@Query("select m from MarketEntity m left join fetch m.positions where m.id = :id")
Optional<MarketEntity> findWithPositions(@Param("id") Long id);
public interface MarketRepository extends JpaRepository<MarketEntity, Long> {
Optional<MarketEntity> findBySlug(String slug);
@Query("select m from MarketEntity m where m.status = :status")
Page<MarketEntity> findByStatus(@Param("status") MarketStatus status, Pageable pageable);
}
public interface MarketSummary {
Long getId();
String getName();
MarketStatus getStatus();
}
Page<MarketSummary> findAllBy(Pageable pageable);
@Transactional ile işaretle@Transactional(readOnly = true) kullan@Transactional
public Market updateStatus(Long id, MarketStatus status) {
MarketEntity entity = repo.findById(id)
.orElseThrow(() -> new EntityNotFoundException("Market"));
entity.setStatus(status);
return Market.from(entity);
}
PageRequest page = PageRequest.of(pageNumber, pageSize, Sort.by("createdAt").descending());
Page<MarketEntity> markets = repo.findByStatus(MarketStatus.ACTIVE, page);
Cursor benzeri sayfalama için, sıralama ile birlikte JPQL'de id > :lastId ekle.
status, slug, foreign key'ler)status, created_at)select * kullanmaktan kaçın; sadece gerekli sütunları project etsaveAll ve hibernate.jdbc.batch_size ile yazmaları batch'leÖnerilen özellikler:
spring.datasource.hikari.maximum-pool-size=20
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.validation-timeout=5000
PostgreSQL LOB işleme için ekle:
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
@DataJpaTest tercih etlogging.level.org.hibernate.SQL=DEBUG ve logging.level.org.hibernate.orm.jdbc.bind=TRACE ayarlaHatırla: Entity'leri yalın, sorguları kasıtlı ve transaction'ları kısa tut. Fetch stratejileri ve projections ile N+1'i önle, ve okuma/yazma yolların için indeksle.