Hello everyone I am trying to get my class to persist to my database however I have run into a problem im not sure how to solve. I am attempting to map the three instances of Score with my user but I am not sure how ti get this to work. Any help is appreciated. Thank you :)
User class Snipit.
@Column(name="userName", unique=true)
private String username;
@Column(name="password")
private String password;
//I am not sure how to map the three fields below.
private Score highestScore;
private Score averageScore;
private Score lowestScore;
While there is an accepted answer here I am not seeing how the proposed mapping distinguishes between the High, Low and Average scores?
You could consider using a Map such as below where the score table will have a column 'score_type' which can be mapped to an Enum 'ScoreType':
and