質問編集履歴

3

追記

2020/05/02 01:23

投稿

aae_11
aae_11

スコア178

test CHANGED
File without changes
test CHANGED
@@ -379,3 +379,185 @@
379
379
 
380
380
 
381
381
  こちらのエラーから[Qiita](https://stackoverflow.com/questions/50904742/property-or-field-name-cannot-be-found-on-object-of-type-java-util-optional)など見てみましたが、未だ解決方法はわかっていない状況です
382
+
383
+
384
+
385
+ 以下は、エンティティクラス「MyData.java」です
386
+
387
+ ```
388
+
389
+ package com.test.springboot;
390
+
391
+ import javax.persistence.Column;
392
+
393
+ import javax.persistence.Entity;
394
+
395
+ import javax.persistence.GeneratedValue;
396
+
397
+ import javax.persistence.GenerationType;
398
+
399
+ import javax.persistence.Id;
400
+
401
+ import javax.persistence.Table;
402
+
403
+
404
+
405
+ @Entity
406
+
407
+ @Table(name="mydata")
408
+
409
+ public class MyData {
410
+
411
+
412
+
413
+ @Id
414
+
415
+ @GeneratedValue(strategy = GenerationType.AUTO)
416
+
417
+ @Column
418
+
419
+ private long id;
420
+
421
+
422
+
423
+ @Column(length = 50,nullable = false)
424
+
425
+ private String name;
426
+
427
+
428
+
429
+ @Column(length = 200,nullable = true)
430
+
431
+ private String mail;
432
+
433
+
434
+
435
+ @Column(nullable = true)
436
+
437
+ private Integer age;
438
+
439
+
440
+
441
+ @Column(nullable = true)
442
+
443
+ private String memo;
444
+
445
+
446
+
447
+ public long getId() {
448
+
449
+
450
+
451
+ return id;
452
+
453
+ }
454
+
455
+ public void setId(long id) {
456
+
457
+
458
+
459
+ this.id = id;
460
+
461
+ }
462
+
463
+
464
+
465
+ public String getName() {
466
+
467
+
468
+
469
+ return name;
470
+
471
+
472
+
473
+ }
474
+
475
+
476
+
477
+ public void setName(String name) {
478
+
479
+
480
+
481
+ this.name = name;
482
+
483
+
484
+
485
+ }
486
+
487
+
488
+
489
+ public String getMail() {
490
+
491
+
492
+
493
+ return mail;
494
+
495
+
496
+
497
+ }
498
+
499
+
500
+
501
+ public void setMail(String mail) {
502
+
503
+
504
+
505
+ this.mail = mail;
506
+
507
+
508
+
509
+ }
510
+
511
+
512
+
513
+ public Integer getAge(){
514
+
515
+
516
+
517
+ return age;
518
+
519
+
520
+
521
+ }
522
+
523
+
524
+
525
+ public void setAge(Integer age) {
526
+
527
+
528
+
529
+ this.age = age;
530
+
531
+
532
+
533
+ }
534
+
535
+
536
+
537
+ public String getMemo() {
538
+
539
+
540
+
541
+ return memo;
542
+
543
+
544
+
545
+ }
546
+
547
+
548
+
549
+ public void setMemo(String memo) {
550
+
551
+
552
+
553
+ this.memo = memo;
554
+
555
+
556
+
557
+ }
558
+
559
+
560
+
561
+ }
562
+
563
+ ```

2

追記

2020/05/02 01:23

投稿

aae_11
aae_11

スコア178

test CHANGED
File without changes
test CHANGED
@@ -361,3 +361,21 @@
361
361
  Eclipseのバージョン: Version: 2019-12 (4.14.0)
362
362
 
363
363
  OS: MacOSMojave
364
+
365
+
366
+
367
+ **追記**
368
+
369
+ エラー内容に下記の行が見当たりました。
370
+
371
+ > Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "id" (template: "edit" - line 18, col 44)
372
+
373
+
374
+
375
+
376
+
377
+ > Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'id' cannot be found on object of type 'java.util.Optional' - maybe not public or not valid?
378
+
379
+
380
+
381
+ こちらのエラーから[Qiita](https://stackoverflow.com/questions/50904742/property-or-field-name-cannot-be-found-on-object-of-type-java-util-optional)など見てみましたが、未だ解決方法はわかっていない状況です

1

修正

2020/05/01 23:48

投稿

aae_11
aae_11

スコア178

test CHANGED
File without changes
test CHANGED
@@ -120,7 +120,7 @@
120
120
 
121
121
  ```
122
122
 
123
- package com.shinya.springboot;
123
+ package com.test.springboot;
124
124
 
125
125
 
126
126