11package main .java .com .example .model ;
22
3+ import java .util .ArrayList ;
4+ import java .util .List ;
5+
36public class Employee extends User {
47 private String employeeName ;
5- private int age ;
6- private String profile ;
7- private String mbti ;
8- private String instagram ;
9- private String [] hashtag ;
8+ private String position ;
9+ private String contact ;
10+
11+ // EmployeeReview와의 1:N 관계
12+ private List <EmployeeReview > reviews = new ArrayList <>();
13+
14+ // Resume와의 1:N 관계
15+ private List <Resume > resumes = new ArrayList <>();
1016
1117 // Getters and Setters
1218 public String getEmployeeName () {
@@ -17,53 +23,52 @@ public void setEmployeeName(String employeeName) {
1723 this .employeeName = employeeName ;
1824 }
1925
20- public int getAge () {
21- return age ;
22- }
23-
24- public void setAge (int age ) {
25- this .age = age ;
26- }
27-
28- public String getProfile () {
29- return profile ;
26+ public String getPosition () {
27+ return position ;
3028 }
3129
32- public void setProfile (String profile ) {
33- this .profile = profile ;
30+ public void setPosition (String position ) {
31+ this .position = position ;
3432 }
3533
36- public String getMbti () {
37- return mbti ;
34+ public String getContact () {
35+ return contact ;
3836 }
3937
40- public void setMbti (String mbti ) {
41- this .mbti = mbti ;
38+ public void setContact (String contact ) {
39+ this .contact = contact ;
4240 }
4341
44- public String getInstagram () {
45- return instagram ;
42+ public List < EmployeeReview > getReviews () {
43+ return reviews ;
4644 }
4745
48- public void setInstagram (String instagram ) {
49- this .instagram = instagram ;
46+ public void addReview (EmployeeReview review ) {
47+ reviews .add (review );
48+ review .setEmployee (this ); // Employee 객체 설정
5049 }
5150
52- public String [] getHashtag () {
53- return hashtag ;
51+ public List < Resume > getResumes () {
52+ return resumes ;
5453 }
5554
56- public void setHashtag (String [] hashtag ) {
57- this .hashtag = hashtag ;
55+ public void addResume (Resume resume ) {
56+ resumes .add (resume );
57+ resume .setEmployee (this ); // Resume 객체와의 관계 설정
5858 }
5959
6060 @ Override
6161 public void displayUserInfo () {
6262 System .out .println ("Employee Name: " + employeeName );
63- System .out .println ("Age: " + age );
64- System .out .println ("Profile: " + profile );
65- System .out .println ("MBTI: " + mbti );
66- System .out .println ("Instagram: " + instagram );
67- System .out .println ("Hashtags: " + String .join (", " , hashtag ));
63+ System .out .println ("Position: " + position );
64+ System .out .println ("Contact: " + contact );
65+ System .out .println ("Resumes:" );
66+ for (Resume resume : resumes ) {
67+ System .out .println ("- Resume ID: " + resume .getResumeId () + ", Title: " + resume .getTitle ());
68+ }
69+ System .out .println ("Reviews:" );
70+ for (EmployeeReview review : reviews ) {
71+ System .out .println ("- Review ID: " + review .getReviewId () + ", Rating: " + review .getRating ());
72+ }
6873 }
6974}
0 commit comments