New posts for Spring and Hibernate

This commit is contained in:
2026-11-06 01:05:17 +05:30
parent b83cc9988e
commit 0245c00033
57 changed files with 2113 additions and 0 deletions
@@ -0,0 +1,23 @@
package com.ankurm.idgen;
import jakarta.persistence.*;
import java.util.UUID;
import org.hibernate.annotations.UuidGenerator;
/** SEQUENCE with allocationSize = 50 (the JPA default): one sequence round trip per 50 entities (pooled optimizer). */
@Entity
public class SeqPooledItem {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_pooled_item")
@SequenceGenerator(name = "seq_pooled_item", sequenceName = "seq_pooled_item", allocationSize = 50)
private Long id;
private String name;
public SeqPooledItem() {}
public SeqPooledItem(String name) { this.name = name; }
public Long getId() { return id; }
public String getName() { return name; }
}