-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] Routine 엔티티 구체화 #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전반적으로 생각 많이 하시고 한 것 같아 보기 좋습니다~~ 그런데 저희 변동사항이 조금 있어서 1월 2일 오늘 최종 GUI나오고 한 번 더 회의 해봅시당~~
public enum HappinessTheme { | ||
CLOSER_TO_ME("나와 더 가까워지기💖"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
미리 이렇게 값까지 넣는 거 너무 보기 좋습니다~~
@@ -42,7 +43,7 @@ public class Member extends BaseTime { | |||
|
|||
@Column(columnDefinition = "TEXT", nullable = false) | |||
@Convert(converter = StringListConverter.class) | |||
private List<DailyTheme> themes; | |||
private List<String> themes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 잘 몰라서 그런데 원래 있던 거에서 String으로 바꾼 이유 한 번만 설명 부탁드려도 될까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DailyTheme이 Enum에서 Entity로 바껴서 String으로 바뀐 거 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csb9427 찬님 말씀대로 Entity 값을 고대로 넣을 수 없기 때문에 Converter 가능한 String 형식으로 우선 변경해두었어요! 테마 관련 기능 확정되고 수정해도 좋을 듯 해요 :)
@@ -42,7 +43,7 @@ public class Member extends BaseTime { | |||
|
|||
@Column(columnDefinition = "TEXT", nullable = false) | |||
@Convert(converter = StringListConverter.class) | |||
private List<DailyTheme> themes; | |||
private List<String> themes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DailyTheme이 Enum에서 Entity로 바껴서 String으로 바뀐 거 같습니다!
ENVIRONMENT("환경🍃"), | ||
EMPTY("비워내기🗑️"), | ||
IMMERSION("몰입을 위한 준비🔥"), | ||
OVERCOME_HELPLESSNESS("무기력 극복☔️"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P4 : 여기 뒤에 , 붙어도 돌아가나요??? 궁금해서 여쭤봅니다 ㅎㅎ!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Chan531 네! ,
로 구분하고 ;
로 맺음 짓는 것만 지키면 실행되는 것으로 알고 있어요. 나중에 값을 추가할 때 편리하도록 지정한 것이고, 코드 스타일을 맞추는 과정에서 끝에는 ,
빼도 상관은 없습니다 ~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 거 알아갑니다~!
this.member.initHappinessRoutine(); | ||
} | ||
this.member = member; | ||
member.addHappinessRoutine(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P4 : init을 통해 Member의 HappinessRoutine을 null로 만들어준 다음, add를 통해 HappinessRoutine를 this로 설정해주고 있는데 null로 만들어주는 과정이 중간에 있는 이유가 궁금합니다!! 그냥 this로 바로 설정해도 될 거 같아서요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csb9427 해당 메소드는 member의 값을 선언해주는 것인데, 이미 선언된 member 값이 있다면 member의 happinessRoutine 멤벼 변수도 업데이트 해주어야 양방향 관계가 깨지는 것에 대비할 수 있어 추가한 로직이에요!
사실 현재 서비스 기획 특성 상 위와 같은 상황은 없을 것 같긴 해서 this로 바로 설정해도 큰 문제는 없을 것 같아요. 이 부분은 정기모임 때 함께 의논해서 합의점 찾아가면 좋을 것 같아요 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
옙 정성담긴 답변 감사합니다!
} | ||
|
||
private void setMember(Member member) { | ||
if (Objects.nonNull(this.member)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nonNull 같은 것도 있군요! 배워갑니다!
Issue
closed #2
Description