-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8dde25
commit bd508da
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...d-main/classmate/src/main/java/devteamOne/classmate/surveyAnswer/domain/SurveyAnswer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package devteamOne.classmate.surveyAnswer.domain; | ||
|
||
import devteamOne.classmate.survey.domain.Survey; | ||
import devteamOne.classmate.surveyOption.domain.SurveyOption; | ||
import devteamOne.classmate.user.domain.User; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.IdClass; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
|
||
@Entity | ||
@IdClass(SurveyAnswerId.class) | ||
public class SurveyAnswer { | ||
|
||
@Id | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "user_id") | ||
private User user; | ||
|
||
@Id | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "survey_id") | ||
private Survey survey; | ||
|
||
@Id | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "survey_option_id") | ||
private SurveyOption surveyOption; | ||
} |
12 changes: 12 additions & 0 deletions
12
...main/classmate/src/main/java/devteamOne/classmate/surveyAnswer/domain/SurveyAnswerId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package devteamOne.classmate.surveyAnswer.domain; | ||
|
||
import devteamOne.classmate.survey.domain.Survey; | ||
import devteamOne.classmate.surveyOption.domain.SurveyOption; | ||
import devteamOne.classmate.user.domain.User; | ||
import java.io.Serializable; | ||
|
||
public class SurveyAnswerId implements Serializable { | ||
private User user; | ||
private Survey survey; | ||
private SurveyOption surveyOption; | ||
} |