質問編集履歴

3

Markdownの修正

2020/12/19 04:40

投稿

gagagagaga
gagagagaga

スコア0

test CHANGED
File without changes
test CHANGED
@@ -110,6 +110,296 @@
110
110
 
111
111
  ```
112
112
 
113
+ ```Java
114
+
115
+ package models;
116
+
117
+
118
+
119
+ import java.sql.Timestamp;
120
+
121
+
122
+
123
+ import javax.persistence.Column;
124
+
125
+ import javax.persistence.Entity;
126
+
127
+ import javax.persistence.GeneratedValue;
128
+
129
+ import javax.persistence.GenerationType;
130
+
131
+ import javax.persistence.Id;
132
+
133
+ import javax.persistence.NamedQueries;
134
+
135
+ import javax.persistence.NamedQuery;
136
+
137
+ import javax.persistence.Table;
138
+
139
+
140
+
141
+ @Table(name = "reports")
142
+
143
+ @NamedQueries({
144
+
145
+ @NamedQuery(
146
+
147
+ name = "getAllReports",
148
+
149
+ query = "SELECT r FROM Report AS r ORDER BY r.id DESC"
150
+
151
+ ),
152
+
153
+ @NamedQuery(
154
+
155
+ name = "getReportsCount",
156
+
157
+ query = "SELECT COUNT(r) FROM Report AS r"
158
+
159
+ ),
160
+
161
+ @NamedQuery(
162
+
163
+ name = "checkRegisteredName",
164
+
165
+ query = "SELECT COUNT(r) FROM Report AS r WHERE r.name = :name"
166
+
167
+ ),
168
+
169
+ })
170
+
171
+ @Entity
172
+
173
+ public class Report {
174
+
175
+ @Id
176
+
177
+ @Column(name = "id")
178
+
179
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
180
+
181
+ private Integer id;
182
+
183
+
184
+
185
+ @Column(name = "name", nullable = false, unique = true)
186
+
187
+ private String name;
188
+
189
+
190
+
191
+ @Column(name = "author", nullable = false)
192
+
193
+ private String author;
194
+
195
+
196
+
197
+ @Column(name = "year", nullable = false)
198
+
199
+ private String year;
200
+
201
+
202
+
203
+ @Column(name = "magazine", nullable = false)
204
+
205
+ private String magazine;
206
+
207
+
208
+
209
+ @Column(name = "created_at", nullable = false)
210
+
211
+ private Timestamp created_at;
212
+
213
+
214
+
215
+ @Column(name = "department", nullable = false)
216
+
217
+ private Integer department;
218
+
219
+
220
+
221
+ //
222
+
223
+ @Column(name = "data", nullable = false)
224
+
225
+ private String data;
226
+
227
+
228
+
229
+ @Column(name = "updated_at", nullable = false)
230
+
231
+ private Timestamp updated_at;
232
+
233
+
234
+
235
+ @Column(name = "delete_flag", nullable = false)
236
+
237
+ private Integer delete_flag;
238
+
239
+
240
+
241
+ public Integer getId() {
242
+
243
+ return id;
244
+
245
+ }
246
+
247
+
248
+
249
+ public void setId(Integer id) {
250
+
251
+ this.id = id;
252
+
253
+ }
254
+
255
+
256
+
257
+ public String getName() {
258
+
259
+ return name;
260
+
261
+ }
262
+
263
+
264
+
265
+ public void setName(String name) {
266
+
267
+ this.name = name;
268
+
269
+ }
270
+
271
+
272
+
273
+ public String getAuthor() {
274
+
275
+ return author;
276
+
277
+ }
278
+
279
+
280
+
281
+ public void setAuthor(String author) {
282
+
283
+ this.author = author;
284
+
285
+ }
286
+
287
+
288
+
289
+ public String getYear() {
290
+
291
+ return year;
292
+
293
+ }
294
+
295
+
296
+
297
+ public void setYear(String year) {
298
+
299
+ this.year = year;
300
+
301
+ }
302
+
303
+
304
+
305
+ public String getMagazine() {
306
+
307
+ return magazine;
308
+
309
+ }
310
+
311
+
312
+
313
+ public void setMagazine(String magazine) {
314
+
315
+ this.magazine = magazine;
316
+
317
+ }
318
+
319
+
320
+
321
+ public Integer getDepartment() {
322
+
323
+ return department;
324
+
325
+ }
326
+
327
+
328
+
329
+ public void setDepartment(Integer department) {
330
+
331
+ this.department = department;
332
+
333
+ }
334
+
335
+
336
+
337
+ public String getData() {
338
+
339
+ return data;
340
+
341
+ }
342
+
343
+
344
+
345
+ public void setData(String data) {
346
+
347
+ this.data = data;
348
+
349
+ }
350
+
351
+
352
+
353
+ public Timestamp getCreated_at() {
354
+
355
+ return created_at;
356
+
357
+ }
358
+
359
+
360
+
361
+ public void setCreated_at(Timestamp created_at) {
362
+
363
+ this.created_at = created_at;
364
+
365
+ }
366
+
367
+
368
+
369
+ public Timestamp getUpdated_at() {
370
+
371
+ return updated_at;
372
+
373
+ }
374
+
375
+
376
+
377
+ public void setUpdated_at(Timestamp updated_at) {
378
+
379
+ this.updated_at = updated_at;
380
+
381
+ }
382
+
383
+
384
+
385
+ public Integer getDelete_flag() {
386
+
387
+ return delete_flag;
388
+
389
+ }
390
+
391
+
392
+
393
+ public void setDelete_flag(Integer delete_flag) {
394
+
395
+ this.delete_flag = delete_flag;
396
+
397
+ }
398
+
399
+ }
400
+
401
+ ```
402
+
113
403
 
114
404
 
115
405
  ### 試したこと

2

Markdownの修正

2020/12/19 04:40

投稿

gagagagaga
gagagagaga

スコア0

test CHANGED
File without changes
test CHANGED
@@ -16,9 +16,9 @@
16
16
 
17
17
  現在の仕様だと、どのページでも同じpdfファイルのダウンロードになってしまいます。
18
18
 
19
- `Java`
20
19
 
21
20
 
21
+ ```
22
22
 
23
23
  ```Java
24
24
 
@@ -108,12 +108,6 @@
108
108
 
109
109
  }
110
110
 
111
-
112
-
113
- ```ここに言語名を入力
114
-
115
- Java
116
-
117
111
  ```
118
112
 
119
113
 

1

Markdownの修正

2020/12/19 04:05

投稿

gagagagaga
gagagagaga

スコア0

test CHANGED
File without changes
test CHANGED
@@ -16,9 +16,11 @@
16
16
 
17
17
  現在の仕様だと、どのページでも同じpdfファイルのダウンロードになってしまいます。
18
18
 
19
- ```
19
+ `Java`
20
20
 
21
21
 
22
+
23
+ ```Java
22
24
 
23
25
  @WebServlet("/reports/download")
24
26
 
@@ -110,7 +112,7 @@
110
112
 
111
113
  ```ここに言語名を入力
112
114
 
113
- Sevlet
115
+ Java
114
116
 
115
117
  ```
116
118