Skip to content

Commit 365a81d

Browse files
committed
sample update for spring-boot 3.2
1 parent 13d3533 commit 365a81d

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

demo-oauth2/oauth-resource-server-webmvc/src/main/java/org/springdoc/demo/resource/model/Foo.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.springdoc.demo.resource.model;
22

3+
import java.util.UUID;
4+
35
import jakarta.persistence.Entity;
46
import jakarta.persistence.GeneratedValue;
57
import jakarta.persistence.GenerationType;
@@ -9,8 +11,8 @@
911
public class Foo {
1012

1113
@Id
12-
@GeneratedValue(strategy = GenerationType.IDENTITY)
13-
private Long id;
14+
@GeneratedValue(strategy = GenerationType.UUID)
15+
private UUID id;
1416

1517
private String name;
1618

@@ -21,11 +23,11 @@ public Foo(String name) {
2123
this.name = name;
2224
}
2325

24-
public Long getId() {
26+
public UUID getId() {
2527
return id;
2628
}
2729

28-
public void setId(Long id) {
30+
public void setId(UUID id) {
2931
this.id = id;
3032
}
3133

demo-oauth2/oauth-resource-server-webmvc/src/main/java/org/springdoc/demo/resource/web/dto/FooDTO.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
package org.springdoc.demo.resource.web.dto;
22

3+
import java.util.UUID;
4+
35
public class FooDTO {
4-
private long id;
6+
private UUID id;
57

68
private String name;
79

810
public FooDTO() {
911
super();
1012
}
1113

12-
public FooDTO(final long id, final String name) {
14+
public FooDTO(final UUID id, final String name) {
1315
super();
1416

1517
this.id = id;
1618
this.name = name;
1719
}
1820

19-
//
20-
21-
public long getId() {
21+
public UUID getId() {
2222
return id;
2323
}
2424

25-
public void setId(final long id) {
25+
public void setId(UUID id) {
2626
this.id = id;
2727
}
2828

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
INSERT INTO Foo(id, name)
2-
VALUES (1, 'Foo 1');
2+
VALUES ('dc58c780-a571-437e-85e2-9be232c5cd80', 'Foo 1');
33
INSERT INTO Foo(id, name)
4-
VALUES (2, 'Foo 2');
4+
VALUES ('dc58c780-a571-437e-85e2-9be232c5cd84', 'Foo 2');
55
INSERT INTO Foo(id, name)
6-
VALUES (3, 'Foo 3');
6+
VALUES ('dc58c780-a571-437e-85e2-9be232c5cd83', 'Foo 3');
77

0 commit comments

Comments
 (0)