File tree 3 files changed +15
-13
lines changed
demo-oauth2/oauth-resource-server-webmvc/src/main
java/org/springdoc/demo/resource
3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 1
1
package org .springdoc .demo .resource .model ;
2
2
3
+ import java .util .UUID ;
4
+
3
5
import jakarta .persistence .Entity ;
4
6
import jakarta .persistence .GeneratedValue ;
5
7
import jakarta .persistence .GenerationType ;
9
11
public class Foo {
10
12
11
13
@ Id
12
- @ GeneratedValue (strategy = GenerationType .IDENTITY )
13
- private Long id ;
14
+ @ GeneratedValue (strategy = GenerationType .UUID )
15
+ private UUID id ;
14
16
15
17
private String name ;
16
18
@@ -21,11 +23,11 @@ public Foo(String name) {
21
23
this .name = name ;
22
24
}
23
25
24
- public Long getId () {
26
+ public UUID getId () {
25
27
return id ;
26
28
}
27
29
28
- public void setId (Long id ) {
30
+ public void setId (UUID id ) {
29
31
this .id = id ;
30
32
}
31
33
Original file line number Diff line number Diff line change 1
1
package org .springdoc .demo .resource .web .dto ;
2
2
3
+ import java .util .UUID ;
4
+
3
5
public class FooDTO {
4
- private long id ;
6
+ private UUID id ;
5
7
6
8
private String name ;
7
9
8
10
public FooDTO () {
9
11
super ();
10
12
}
11
13
12
- public FooDTO (final long id , final String name ) {
14
+ public FooDTO (final UUID id , final String name ) {
13
15
super ();
14
16
15
17
this .id = id ;
16
18
this .name = name ;
17
19
}
18
20
19
- //
20
-
21
- public long getId () {
21
+ public UUID getId () {
22
22
return id ;
23
23
}
24
24
25
- public void setId (final long id ) {
25
+ public void setId (UUID id ) {
26
26
this .id = id ;
27
27
}
28
28
Original file line number Diff line number Diff line change 1
1
INSERT INTO Foo(id, name)
2
- VALUES (1 , ' Foo 1' );
2
+ VALUES (' dc58c780-a571-437e-85e2-9be232c5cd80 ' , ' Foo 1' );
3
3
INSERT INTO Foo(id, name)
4
- VALUES (2 , ' Foo 2' );
4
+ VALUES (' dc58c780-a571-437e-85e2-9be232c5cd84 ' , ' Foo 2' );
5
5
INSERT INTO Foo(id, name)
6
- VALUES (3 , ' Foo 3' );
6
+ VALUES (' dc58c780-a571-437e-85e2-9be232c5cd83 ' , ' Foo 3' );
7
7
You can’t perform that action at this time.
0 commit comments