Skip to content

Commit

Permalink
test define sequenceGenerators and allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rwolfe-Nava committed Oct 6, 2023
1 parent 6ecdc79 commit 777434d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.SequenceGenerator;
import jakarta.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand All @@ -23,7 +24,12 @@
public class CoveragePeriod extends TimestampBase {

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "bene_coverage_period_seq")
@SequenceGenerator(
name = "bene_coverage_period_seq",
sequenceName = "bene_coverage_period_seq",
allocationSize = 1
)
private Integer id;

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.SequenceGenerator;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
Expand All @@ -29,7 +30,12 @@
public class CoverageSearchEvent extends TimestampBase {

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "event_bene_coverage_search_status_change_seq")
@SequenceGenerator(
name = "event_bene_coverage_search_status_change_seq",
sequenceName = "event_bene_coverage_search_status_change_seq",
allocationSize = 1
)
@EqualsAndHashCode.Include
private Long id;

Expand Down

0 comments on commit 777434d

Please sign in to comment.