Skip to content

Commit

Permalink
[Refactor] : 일부 컬럼 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbang105 committed Aug 14, 2024
1 parent a588d5a commit b0b7cf6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/side/onetime/domain/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Member extends BaseEntity {
private String pin;

@OneToMany(mappedBy = "member",cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<Schedule> schedules;
private List<Selection> selections;

@Builder
public Member(Event event, String name, String pin) {
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/side/onetime/domain/Schedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import side.onetime.global.common.dao.BaseEntity;

import java.time.LocalDateTime;
import java.util.List;

@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand All @@ -20,8 +21,8 @@ public class Schedule extends BaseEntity {
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "members_id", foreignKey = @ForeignKey(name = "schedules_fk_members_id"))
private Member member;
@JoinColumn(name = "events_id", foreignKey = @ForeignKey(name = "schedules_fk_events_id"))
private Event event;

@Column(name = "date", nullable = false)
private LocalDateTime date;
Expand All @@ -32,19 +33,14 @@ public class Schedule extends BaseEntity {
@Column(name = "time", nullable = false)
private LocalDateTime time;

@Column(name = "is_selected", nullable = false)
private Boolean isSelected;
@OneToMany(mappedBy = "schedule",cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<Selection> selections;

@Builder
public Schedule(Member member, LocalDateTime date, String day, LocalDateTime time) {
this.member = member;
public Schedule(Event event, LocalDateTime date, String day, LocalDateTime time) {
this.event = event;
this.date = date;
this.day = day;
this.time = time;
this.isSelected = false;
}

public void updateIsSelected(boolean isSelected) {
this.isSelected = isSelected;
}
}

0 comments on commit b0b7cf6

Please sign in to comment.