質問編集履歴
2
バージョンの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,6 +7,16 @@
|
|
7
7
|
含んでいると起動時に異常終了してしまいます。
|
8
8
|
|
9
9
|
解決策はありますでしょうか?
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
◆環境
|
14
|
+
|
15
|
+
Spring Tool Suite 4 Version: 4.8.1
|
16
|
+
|
17
|
+
SpringBoot2
|
18
|
+
|
19
|
+
Java8
|
10
20
|
|
11
21
|
|
12
22
|
|
1
コードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,8 +8,124 @@
|
|
8
8
|
|
9
9
|
解決策はありますでしょうか?
|
10
10
|
|
11
|
-
例えば
|
12
11
|
|
13
|
-
fingByEMPL_ID(String emplid)
|
14
12
|
|
15
|
-
|
13
|
+
◆リボジトリ
|
14
|
+
|
15
|
+
```ここに言語を入力
|
16
|
+
|
17
|
+
@Repository
|
18
|
+
|
19
|
+
public interface BsLoginUserRPS extends JpaRepository<BsLoginUser,String>{
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
// JPAメソッドによるQuary自動生成(カラム名に連動)
|
24
|
+
|
25
|
+
public Optional<BsLoginUser> findByLOGIN_IDAndCOMPANY_ID(String lid,String cid);
|
26
|
+
|
27
|
+
}
|
28
|
+
|
29
|
+
```
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
◆テーブル
|
34
|
+
|
35
|
+
```ここに言語を入力
|
36
|
+
|
37
|
+
CREATE TABLE BS_LOGIN_USER
|
38
|
+
|
39
|
+
(
|
40
|
+
|
41
|
+
LOGIN_ID VARCHAR2(8) NOT NULL ENABLE,
|
42
|
+
|
43
|
+
COMPANY_ID VARCHAR2(20),
|
44
|
+
|
45
|
+
PASSWORD VARCHAR2(50),
|
46
|
+
|
47
|
+
NAME NVARCHAR2(20)
|
48
|
+
|
49
|
+
)
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
◆エンティティ
|
56
|
+
|
57
|
+
```ここに言語を入力
|
58
|
+
|
59
|
+
@Entity
|
60
|
+
|
61
|
+
@Table(name = "BS_LOGIN_USER")
|
62
|
+
|
63
|
+
public class BsLoginUser {
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
/**
|
68
|
+
|
69
|
+
* loginIdプロパティ
|
70
|
+
|
71
|
+
*/
|
72
|
+
|
73
|
+
@Id
|
74
|
+
|
75
|
+
@Column(name = "LOGIN_ID")
|
76
|
+
|
77
|
+
public String loginId;
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
/**
|
82
|
+
|
83
|
+
* companyIdプロパティ
|
84
|
+
|
85
|
+
*/
|
86
|
+
|
87
|
+
@Column(name = "COMPANY_ID")
|
88
|
+
|
89
|
+
public String companyId;
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
/**
|
94
|
+
|
95
|
+
* passwordプロパティ
|
96
|
+
|
97
|
+
*/
|
98
|
+
|
99
|
+
@Column(name = "PASSWORD")
|
100
|
+
|
101
|
+
public String password;
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
/**
|
106
|
+
|
107
|
+
* nameプロパティ
|
108
|
+
|
109
|
+
*/
|
110
|
+
|
111
|
+
@Column(name = "NAME")
|
112
|
+
|
113
|
+
public String name;
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
```
|
118
|
+
|
119
|
+
◆エラー
|
120
|
+
|
121
|
+
```ここに言語を入力
|
122
|
+
|
123
|
+
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
|
124
|
+
|
125
|
+
2021-02-09 11:38:36.795, [ ERROR ], org.springframework.boot.SpringApplication, Application run failed
|
126
|
+
|
127
|
+
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'loginSevice': Unsatisfied dependency expressed through field 'repository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bsLoginUserRPS' defined in jp.psf.shoryu.Repository.BsLoginUserRPS defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.Optional jp.psf.shoryu.Repository.BsLoginUserRPS.findByLOGIN_IDAndCOMPANY_ID(java.lang.String,java.lang.String)! No property LOGIN found for type BsLoginUser!
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
```
|