1
2
3
4
5
6 package com.hack23.cia.model.application.impl.common;
7
8 import java.util.Set;
9
10 import javax.persistence.CascadeType;
11 import javax.persistence.Entity;
12 import javax.persistence.FetchType;
13 import javax.persistence.GeneratedValue;
14 import javax.persistence.GenerationType;
15 import javax.persistence.Id;
16 import javax.persistence.JoinTable;
17 import javax.persistence.OneToMany;
18 import javax.persistence.Version;
19
20 import org.hibernate.annotations.Cache;
21 import org.hibernate.annotations.CacheConcurrencyStrategy;
22
23 import com.hack23.cia.model.core.impl.BaseEntity;
24
25 /***
26 * The Class PoliticalGame.
27 */
28 @Entity
29 @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
30 public class PoliticalGame extends BaseEntity {
31
32 /*** The Constant serialVersionUID. */
33 private static final long serialVersionUID = -1381199844545595026L;
34
35 /*** The game boards. */
36 private Set<GameBoard> gameBoards;
37
38
39 /*** The id. */
40 private Long id;
41
42 /*** The version. */
43 private Long version=1L;
44
45 /***
46 * Instantiates a new political game.
47 */
48 public PoliticalGame() {
49 }
50
51 /***
52 * Gets the game boards.
53 *
54 * @return the game boards
55 */
56 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
57 @JoinTable(name = "PoliticalGameBoards")
58 public Set<GameBoard> getGameBoards() {
59 return gameBoards;
60 }
61
62
63
64
65
66
67
68 @Override
69 @Id
70 @GeneratedValue(strategy = GenerationType.AUTO)
71 public Long getId() {
72 return id;
73 }
74
75
76
77
78 @Override
79 @Version
80 public Long getVersion() {
81 return version;
82 }
83
84 /***
85 * Sets the game boards.
86 *
87 * @param gameBoards the new game boards
88 */
89 public void setGameBoards(final Set<GameBoard> gameBoards) {
90 this.gameBoards = gameBoards;
91 }
92
93 /***
94 * Sets the id.
95 *
96 * @param id the new id
97 */
98 public void setId(final Long id) {
99 this.id = id;
100 }
101
102 /***
103 * Sets the version.
104 *
105 * @param version the new version
106 */
107 public void setVersion(final Long version) {
108 this.version = version;
109 }
110 }