From 502365b6061811efcebc28d4a84b8c9341ddd59b Mon Sep 17 00:00:00 2001 From: Lee Hangil Date: Mon, 15 Jul 2024 22:23:15 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20-=20Database=20=EC=98=88=EC=95=BD?= =?UTF-8?q?=EC=96=B4=EC=98=80=EB=8D=98=20Entity=20=ED=95=84=EB=93=9C?= =?UTF-8?q?=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../woowacourse/touroot/travelogue/domain/Travelogue.java | 2 +- .../touroot/travelogueday/domain/TravelogueDay.java | 4 ++-- .../touroot/traveloguephoto/domain/TraveloguePhoto.java | 6 +++--- .../touroot/travelogueplace/domain/TraveloguePlace.java | 6 +++--- backend/src/main/resources/application.yml | 3 +++ 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/woowacourse/touroot/travelogue/domain/Travelogue.java b/backend/src/main/java/woowacourse/touroot/travelogue/domain/Travelogue.java index 1899e848..bc6d0d8e 100644 --- a/backend/src/main/java/woowacourse/touroot/travelogue/domain/Travelogue.java +++ b/backend/src/main/java/woowacourse/touroot/travelogue/domain/Travelogue.java @@ -25,5 +25,5 @@ public class Travelogue { private String thumbnail; @OneToMany(mappedBy = "travelogue") - private List days; + private List travelogueDays; } diff --git a/backend/src/main/java/woowacourse/touroot/travelogueday/domain/TravelogueDay.java b/backend/src/main/java/woowacourse/touroot/travelogueday/domain/TravelogueDay.java index 2123b5b9..c39aad00 100644 --- a/backend/src/main/java/woowacourse/touroot/travelogueday/domain/TravelogueDay.java +++ b/backend/src/main/java/woowacourse/touroot/travelogueday/domain/TravelogueDay.java @@ -22,7 +22,7 @@ public class TravelogueDay { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - @Column(nullable = false) + @Column(name = "DAY_ORDER", nullable = false) private Integer order; @JoinColumn(nullable = false) @@ -30,5 +30,5 @@ public class TravelogueDay { private Travelogue travelogue; @OneToMany(mappedBy = "travelogueDay") - private List places; + private List traveloguePlaces; } diff --git a/backend/src/main/java/woowacourse/touroot/traveloguephoto/domain/TraveloguePhoto.java b/backend/src/main/java/woowacourse/touroot/traveloguephoto/domain/TraveloguePhoto.java index 9bb79e4e..0ee66819 100644 --- a/backend/src/main/java/woowacourse/touroot/traveloguephoto/domain/TraveloguePhoto.java +++ b/backend/src/main/java/woowacourse/touroot/traveloguephoto/domain/TraveloguePhoto.java @@ -19,13 +19,13 @@ public class TraveloguePhoto { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - @Column(nullable = false) + @Column(name = "PHOTO_KEY", nullable = false) private String key; - @Column(nullable = false) + @Column(name = "PHOTO_ORDER", nullable = false) private Integer order; @JoinColumn(nullable = false) @ManyToOne(fetch = FetchType.LAZY) - private TraveloguePlace place; + private TraveloguePlace traveloguePlace; } diff --git a/backend/src/main/java/woowacourse/touroot/travelogueplace/domain/TraveloguePlace.java b/backend/src/main/java/woowacourse/touroot/travelogueplace/domain/TraveloguePlace.java index 4b932fa2..9b17717c 100644 --- a/backend/src/main/java/woowacourse/touroot/travelogueplace/domain/TraveloguePlace.java +++ b/backend/src/main/java/woowacourse/touroot/travelogueplace/domain/TraveloguePlace.java @@ -23,7 +23,7 @@ public class TraveloguePlace { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - @Column(nullable = false) + @Column(name = "PLACE_ORDER", nullable = false) private Integer order; private String description; @@ -34,8 +34,8 @@ public class TraveloguePlace { @JoinColumn(nullable = false) @ManyToOne(fetch = FetchType.LAZY) - private TravelogueDay day; + private TravelogueDay travelogueDay; @OneToMany(mappedBy = "traveloguePlace") - private List photos; + private List traveloguePhotos; } diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index 17164e13..aad6713f 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -1,4 +1,7 @@ spring: + h2: + console: + enabled: true datasource: driver-class-name: org.h2.Driver url: jdbc:h2:mem:test