diff --git a/src/main/java/org/sopt/seminar/domain/member/domain/Member.java b/src/main/java/org/sopt/seminar/domain/member/domain/Member.java new file mode 100644 index 0000000..3cbd05f --- /dev/null +++ b/src/main/java/org/sopt/seminar/domain/member/domain/Member.java @@ -0,0 +1,37 @@ +package org.sopt.seminar.domain.member.domain; + +import jakarta.persistence.*; +import lombok.*; +import org.hibernate.annotations.DynamicUpdate; +import org.sopt.seminar.global.common.BaseTimeEntity; + +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Builder(access = AccessLevel.PRIVATE) +@DynamicUpdate +@Getter +@Entity +public class Member extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "member_id") + private Long id; + private String name; + private String nickname; + private Integer age; + @Embedded + private Sopt sopt; + + public static Member createMember(final String name, final String nickname, final Integer age, final Sopt sopt) { + return Member.builder() + .name(name) + .nickname(nickname) + .age(age) + .sopt(sopt) + .build(); + } + + public void updateSopt(Sopt sopt) { + this.sopt = sopt; + } +}