質問編集履歴
1
不要な文字の削除
title
CHANGED
File without changes
|
body
CHANGED
@@ -60,9 +60,45 @@
|
|
60
60
|
</div>
|
61
61
|
|
62
62
|
|
63
|
+
```
|
63
64
|
|
65
|
+
|
66
|
+
### 追加情報
|
67
|
+
|
68
|
+
修正依頼いただき誠にありがとうございます。説明不足で申し訳ございません。
|
69
|
+
repに関しては、
|
70
|
+
@Autowired
|
71
|
+
DeploymentRepository rep;
|
72
|
+
になります。
|
73
|
+
|
74
|
+
### 該当のRepository
|
64
75
|
```
|
76
|
+
@Repository
|
77
|
+
public interface DeploymentRepository extends JpaRepository<DeploymentEntity, Long> {
|
78
|
+
public Optional<DeploymentEntity> findById(int i);
|
65
79
|
|
80
|
+
@Query(value = "SELECT * FROM m_deployment WHERE delete_flag=0", nativeQuery = true)
|
81
|
+
ArrayList<DeploymentEntity> findDeploymentByDeleteFlag();
|
82
|
+
|
83
|
+
public Optional<DeploymentEntity> findByDeploymentName(String depNmae);
|
84
|
+
}
|
85
|
+
```
|
86
|
+
|
87
|
+
### テーブルDDL
|
88
|
+
create table m_deployment (
|
89
|
+
deployment_id INT AUTO_INCREMENT not null comment '部署ID'
|
90
|
+
, deployment_name VARCHAR(50) UNIQUE not null comment '部署名'
|
91
|
+
, register_date DATETIME comment '登録日'
|
92
|
+
, register_id INT comment '登録者ID'
|
93
|
+
, edit_date DATETIME comment '編集日'
|
94
|
+
, editer_id INT comment '編集者ID'
|
95
|
+
, delete_flag INT comment '削除フラグ'
|
96
|
+
, delete_date DATETIME comment '削除日'
|
97
|
+
, deleter_id INT comment '削除者ID'
|
98
|
+
, sort_num INT comment '並び順'
|
99
|
+
, constraint m_deployment_PKC primary key (deployment_id)
|
100
|
+
) comment '部署テーブル' ;
|
101
|
+
|
66
102
|
### 試したこと
|
67
103
|
|
68
104
|
主キーとしているidに問題があると考え、<input type="hidden" name="deployment_id" th:value="*{id}" form="edit">を追加などしましたが、うまくいきませんでした。
|