回答編集履歴
2
完成版
answer
CHANGED
|
@@ -10,8 +10,13 @@
|
|
|
10
10
|
jpa:
|
|
11
11
|
show-sql: true
|
|
12
12
|
hibernate:
|
|
13
|
+
ddl-auto: validate
|
|
13
14
|
naming:
|
|
14
|
-
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
|
15
|
+
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
|
16
|
+
properties:
|
|
17
|
+
hibernate:
|
|
18
|
+
globally_quoted_identifiers: true
|
|
19
|
+
|
|
15
20
|
|
|
16
21
|
```
|
|
17
22
|
|
|
@@ -47,10 +52,10 @@
|
|
|
47
52
|
import lombok.Data;
|
|
48
53
|
|
|
49
54
|
@Data
|
|
50
|
-
@Table(name = "
|
|
55
|
+
@Table(name = "users", indexes = { //
|
|
51
|
-
@Index(columnList = "
|
|
56
|
+
@Index(columnList = "USERNAME, DELETED", unique = true), //
|
|
52
|
-
@Index(columnList = "
|
|
57
|
+
@Index(columnList = "USERNAME, DELETED", unique = true), //
|
|
53
|
-
}, schema = "
|
|
58
|
+
}, schema = "ORAUSER")
|
|
54
59
|
@Entity
|
|
55
60
|
public class User {
|
|
56
61
|
|
|
@@ -80,6 +85,7 @@
|
|
|
80
85
|
LocalDateTime deleted;
|
|
81
86
|
|
|
82
87
|
}
|
|
88
|
+
|
|
83
89
|
```
|
|
84
90
|
|
|
85
91
|
前提が間違えてた。。 なんか他に設定がありそう
|
1
修正
answer
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
とりあえず確認してみたが、テーブル作成してなかったんだろうね。
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
# application.yml
|
|
5
2
|
|
|
6
3
|
```yml
|
|
@@ -9,12 +6,19 @@
|
|
|
9
6
|
url: jdbc:oracle:thin:@//localhost:1521/MYORCL
|
|
10
7
|
username: orauser
|
|
11
8
|
password: orauser
|
|
9
|
+
|
|
10
|
+
jpa:
|
|
11
|
+
show-sql: true
|
|
12
|
+
hibernate:
|
|
13
|
+
naming:
|
|
14
|
+
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
|
15
|
+
|
|
12
16
|
```
|
|
13
17
|
|
|
14
18
|
# create table
|
|
15
19
|
|
|
16
20
|
```sql
|
|
17
|
-
CREATE TABLE users (
|
|
21
|
+
CREATE TABLE "ORAUSER"."users" (
|
|
18
22
|
id number primary key,
|
|
19
23
|
username varchar2( 50) not null,
|
|
20
24
|
email varchar2( 50) not null,
|
|
@@ -43,41 +47,39 @@
|
|
|
43
47
|
import lombok.Data;
|
|
44
48
|
|
|
45
49
|
@Data
|
|
46
|
-
@Table(name = "users", indexes = { //
|
|
50
|
+
@Table(name = "`users`", indexes = { //
|
|
47
51
|
@Index(columnList = "username, deleted", unique = true), //
|
|
48
52
|
@Index(columnList = "username, deleted", unique = true), //
|
|
49
|
-
})
|
|
53
|
+
}, schema = "`ORAUSER`")
|
|
50
54
|
@Entity
|
|
51
55
|
public class User {
|
|
52
56
|
|
|
53
57
|
@Id
|
|
54
|
-
@Column(nullable = false)
|
|
58
|
+
@Column(name = "ID", nullable = false)
|
|
55
59
|
Long id;
|
|
56
60
|
|
|
57
|
-
@Column(nullable = false)
|
|
61
|
+
@Column(name = "USERNAME", nullable = false)
|
|
58
62
|
String username;
|
|
59
63
|
|
|
60
|
-
@Column(nullable = false)
|
|
64
|
+
@Column(name = "EMAIL", nullable = false)
|
|
61
65
|
String email;
|
|
62
66
|
|
|
63
|
-
@Column(nullable = false)
|
|
67
|
+
@Column(name = "PASSWORD", nullable = false)
|
|
64
68
|
String password;
|
|
65
69
|
|
|
66
|
-
@Column(nullable = false)
|
|
70
|
+
@Column(name = "CREATED", nullable = false)
|
|
67
71
|
@Convert(converter = LocalDateTimeConverter.class)
|
|
68
72
|
LocalDateTime created;
|
|
69
73
|
|
|
70
|
-
@Column(nullable = false)
|
|
74
|
+
@Column(name = "UPDATED", nullable = false)
|
|
71
75
|
@Convert(converter = LocalDateTimeConverter.class)
|
|
72
76
|
LocalDateTime updated;
|
|
73
77
|
|
|
74
|
-
@Column(nullable = true)
|
|
78
|
+
@Column(name = "DELETED", nullable = true)
|
|
75
79
|
@Convert(converter = LocalDateTimeConverter.class)
|
|
76
80
|
LocalDateTime deleted;
|
|
77
81
|
|
|
78
82
|
}
|
|
79
|
-
|
|
80
83
|
```
|
|
81
84
|
|
|
82
|
-
結果正常
|
|
83
|
-
|
|
85
|
+
前提が間違えてた。。 なんか他に設定がありそう
|