Skip to content
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

[BE] MemberTeamPlace 연관관계 편의 메소드 구현 #171

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package team.teamby.teambyteam.member.domain;

import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.teamby.teambyteam.teamplace.domain.TeamPlace;

@Getter
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class MemberTeamPlace {

Expand All @@ -24,4 +21,14 @@ public class MemberTeamPlace {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(nullable = false)
private TeamPlace teamPlace;

public MemberTeamPlace() {
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoArgsConstroctor의 PROTECTED설정을 지우느게 아니라 해당 어노테이션 지우고 직접 작성한 이유가 무엇인가요..?
롬복으로 그냥 하면 되는거 아닌가요??

추가로 아래 멤버와 팀플레이스를 받는 생성자를 만들었으니 @AllArgsContructor가 없어져야 되는게 아닌가 싶습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

실수한 것 같습니다!! 수정해서 push 했습니답


public void setMemberAndTeamPlace(final Member member, final TeamPlace teamPlace) {
this.member = member;
this.teamPlace = teamPlace;
member.getMemberTeamPlaces().add(this);
teamPlace.getMemberTeamPlaces().add(this);
}
}