diff --git a/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Accommodation.java b/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Accommodation.java index 8f07428..5decb07 100644 --- a/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Accommodation.java +++ b/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Accommodation.java @@ -26,7 +26,9 @@ public class Accommodation extends Itinerary{ @Builder public Accommodation(Long id, Trip trip, String itineraryName, String accommodationName, String accommodationRoadAddressName, LocalDateTime checkIn, LocalDateTime checkOut) { - super(id, trip, itineraryName); + this.id = id; + this.trip = trip; + this.itineraryName = itineraryName; this.accommodationName = accommodationName; this.accommodationRoadAddressName = accommodationRoadAddressName; this.checkIn = checkIn; @@ -43,7 +45,7 @@ public AccommodationResponseDTO toAccommodationResponseDTO() { public void updateAccommodationInfo(String itineraryName, String accommodationName, String accommodationRoadAddressName, LocalDateTime checkIn, LocalDateTime checkOut) { - super.updateItineraryName(itineraryName); + this.itineraryName = itineraryName; this.accommodationName = accommodationName; this.accommodationRoadAddressName = accommodationRoadAddressName; this.checkIn = checkIn; diff --git a/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Itinerary.java b/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Itinerary.java index b4cdeff..3e0757f 100644 --- a/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Itinerary.java +++ b/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Itinerary.java @@ -25,21 +25,11 @@ public abstract class Itinerary { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + protected Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "trip_id") - private Trip trip; + protected Trip trip; - private String itineraryName; - - public Itinerary(Long id, Trip trip, String itineraryName) { - this.id = id; - this.trip = trip; - this.itineraryName = itineraryName; - } - - protected void updateItineraryName(String itineraryName) { - this.itineraryName = itineraryName; - } + protected String itineraryName; } diff --git a/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Transportation.java b/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Transportation.java index 1eef1ef..71f026e 100644 --- a/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Transportation.java +++ b/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Transportation.java @@ -32,7 +32,9 @@ public class Transportation extends Itinerary{ public Transportation(Long id, Trip trip, String itineraryName, String transportation, String departurePlace, String departurePlaceRoadAddressName, String destination, String destinationRoadAddressName, LocalDateTime arrivalTime, LocalDateTime departureTime) { - super(id, trip, itineraryName); + this.id = id; + this.trip = trip; + this.itineraryName = itineraryName; this.transportation = transportation; this.departurePlace = departurePlace; this.departurePlaceRoadAddressName = departurePlaceRoadAddressName; @@ -56,7 +58,7 @@ public TransportationResponseDTO toTransportationResponseDTO() { public void updateTransportationInfo(String itineraryName, String transportation, String departurePlace, String departurePlaceRoadAddressName, String destination, String destinationRoadAddressName, LocalDateTime departureTime, LocalDateTime arrivalTime) { - super.updateItineraryName(itineraryName); + this.itineraryName = itineraryName; this.transportation = transportation; this.departurePlace = departurePlace; this.departurePlaceRoadAddressName = departurePlaceRoadAddressName; diff --git a/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Visit.java b/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Visit.java index 4535895..bec8549 100644 --- a/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Visit.java +++ b/src/main/java/com/fc/toy_project2/domain/itinerary/entity/Visit.java @@ -23,9 +23,11 @@ public class Visit extends Itinerary { private LocalDateTime departureTime; @Builder - public Visit(Long id, Trip trip, String itineraryName, String placeName, String placeRoadAddressName, LocalDateTime arrivalTime, - LocalDateTime departureTime) { - super(id, trip, itineraryName); + public Visit(Long id, Trip trip, String itineraryName, String placeName, + String placeRoadAddressName, LocalDateTime arrivalTime, LocalDateTime departureTime) { + this.id = id; + this.trip = trip; + this.itineraryName = itineraryName; this.placeName = placeName; this.placeRoadAddressName = placeRoadAddressName; this.arrivalTime = arrivalTime; @@ -42,7 +44,7 @@ public VisitResponseDTO toVisitResponseDTO() { public void updateVisitInfo(String itineraryName, String placeName, String placeRoadAddressName, LocalDateTime visitDepartureTime, LocalDateTime visitArrivalTime) { - super.updateItineraryName(itineraryName); + this.itineraryName = itineraryName; this.placeName = placeName; this.placeRoadAddressName = placeRoadAddressName; this.departureTime = visitDepartureTime;