|
@@ -8,7 +8,7 @@ import java.util.Set;
|
8
|
8
|
public class User {
|
9
|
9
|
|
10
|
10
|
@Id
|
11
|
|
- @GeneratedValue
|
|
11
|
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
|
12
|
12
|
private long id;
|
13
|
13
|
private String summary;
|
14
|
14
|
private String profileName;
|
|
@@ -20,9 +20,9 @@ public class User {
|
20
|
20
|
CascadeType.MERGE
|
21
|
21
|
})
|
22
|
22
|
@JoinTable(name = "user_game",
|
23
|
|
- joinColumns = {@JoinColumn(name = "user_id")},
|
24
|
|
- inverseJoinColumns = {@JoinColumn(name = "game_id")})
|
25
|
|
- private Set<Game> games;
|
|
23
|
+ joinColumns = {@JoinColumn(name = "user_id")},
|
|
24
|
+ inverseJoinColumns = {@JoinColumn(name = "game_id")})
|
|
25
|
+ private Set<Game> gameLibrary;
|
26
|
26
|
|
27
|
27
|
public long getId() {
|
28
|
28
|
return id;
|
|
@@ -52,16 +52,20 @@ public class User {
|
52
|
52
|
this.userName = userName;
|
53
|
53
|
}
|
54
|
54
|
|
55
|
|
- public Set<Game> getGames() { return games; }
|
56
|
55
|
|
57
|
|
- public void setGames(Set<Game> gameIds) {
|
58
|
|
- this.games = games;
|
|
56
|
+ public Set<Game> getGameLibrary() {
|
|
57
|
+ return gameLibrary;
|
|
58
|
+ }
|
|
59
|
+
|
|
60
|
+ public void setGameLibrary(Set<Game> gameLibrary) {
|
|
61
|
+ this.gameLibrary = gameLibrary;
|
59
|
62
|
}
|
60
|
63
|
|
61
|
64
|
public void addGames(Game game){
|
62
|
|
- if(games==null){
|
63
|
|
- this.games = new HashSet<Game>();
|
|
65
|
+ if(gameLibrary==null){
|
|
66
|
+ this.gameLibrary = new HashSet<Game>();
|
64
|
67
|
}
|
65
|
|
- games.add(game);
|
|
68
|
+ gameLibrary.add(game);
|
66
|
69
|
}
|
|
70
|
+
|
67
|
71
|
}
|