File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/main/java/com/example/postgresdemo/model Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 7
7
@ Table (name = "answers" )
8
8
public class Answer extends AuditModel {
9
9
@ Id
10
- @ GeneratedValue (strategy = GenerationType .IDENTITY )
10
+ @ GeneratedValue (generator = "answer_generator" )
11
+ @ SequenceGenerator (
12
+ name = "answer_generator" ,
13
+ sequenceName = "answer_sequence" ,
14
+ initialValue = 1000
15
+ )
11
16
private Long id ;
12
17
13
18
@ Column (columnDefinition = "text" )
Original file line number Diff line number Diff line change 8
8
@ Table (name = "questions" )
9
9
public class Question extends AuditModel {
10
10
@ Id
11
- @ GeneratedValue (strategy = GenerationType .IDENTITY )
11
+ @ GeneratedValue (generator = "question_generator" )
12
+ @ SequenceGenerator (
13
+ name = "question_generator" ,
14
+ sequenceName = "question_sequence" ,
15
+ initialValue = 1000
16
+ )
12
17
private Long id ;
13
18
14
19
@ NotBlank
You can’t perform that action at this time.
0 commit comments