-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameCommission.java
123 lines (98 loc) · 2.84 KB
/
GameCommission.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.mycompany.myapp.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
import java.util.HashSet;
import java.util.Set;
/**
* A GameCommission.
*/
@Entity
@Table(name = "game_commission")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class GameCommission implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "commission")
private Integer commission;
@OneToMany(mappedBy = "gameCommission")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Game> games = new HashSet<>();
@ManyToOne
@JsonIgnoreProperties("commissions")
private GameUser gameUser;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getCommission() {
return commission;
}
public GameCommission commission(Integer commission) {
this.commission = commission;
return this;
}
public void setCommission(Integer commission) {
this.commission = commission;
}
public Set<Game> getGames() {
return games;
}
public GameCommission games(Set<Game> games) {
this.games = games;
return this;
}
public GameCommission addGame(Game game) {
this.games.add(game);
game.setGameCommission(this);
return this;
}
public GameCommission removeGame(Game game) {
this.games.remove(game);
game.setGameCommission(null);
return this;
}
public void setGames(Set<Game> games) {
this.games = games;
}
public GameUser getGameUser() {
return gameUser;
}
public GameCommission gameUser(GameUser gameUser) {
this.gameUser = gameUser;
return this;
}
public void setGameUser(GameUser gameUser) {
this.gameUser = gameUser;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof GameCommission)) {
return false;
}
return id != null && id.equals(((GameCommission) o).id);
}
@Override
public int hashCode() {
return 31;
}
@Override
public String toString() {
return "GameCommission{" +
"id=" + getId() +
", commission=" + getCommission() +
"}";
}
}