add sequence for ids

This commit is contained in:
esmailian
2025-04-29 17:39:38 +03:30
parent 2edcd4486c
commit 074e802a7d
2 changed files with 4 additions and 2 deletions

View File

@ -15,7 +15,7 @@ import static jakarta.persistence.GenerationType.SEQUENCE;
public class OrderEntity {
@Id
@SequenceGenerator(name = "seqTest", sequenceName = "testapp.order_seq", allocationSize = 1)
@SequenceGenerator(name = "seqTest", sequenceName = "USER_SEQ", allocationSize = 1)
@GeneratedValue(strategy = SEQUENCE, generator = "seqTest")
private Long id;
@Column(name = "order_name")

View File

@ -15,5 +15,7 @@
<column name="last_name" value="Reza"/>
</insert>
</changeSet>
<changeSet id="1.1-2-sequence" author="mmad">
<createSequence sequenceName="USER_SEQ" startValue="1" incrementBy="1"/>
</changeSet>
</databaseChangeLog>