Skip to content

Commit bd438e2

Browse files
committed
Adding @GeneratedValue(strategy = GenerationType.AUTO) in entity.ftl
1 parent c78e128 commit bd438e2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main/java/org/ngbsn/model/annotations/fieldAnnotations/GeneratedValueAnnotation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ public class GeneratedValueAnnotation implements Annotation {
88

99
@Override
1010
public String toString() {
11-
return "@GeneratedValue(strategy = GenerationType.IDENTITY)";
11+
return "@GeneratedValue(strategy = GenerationType.AUTO)";
1212
}
1313
}

src/main/resources/templates/entity.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class ${table.className}{
3939
<#list table.columns as column>
4040
<#if column.primaryKey == true>
4141
@Id
42+
@GeneratedValue(strategy = GenerationType.AUTO)
4243
</#if>
4344
<#list column.annotations as annotation>
4445
${annotation}

0 commit comments

Comments
 (0)