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.Entity;
11 import javax.persistence.GeneratedValue;
12 import javax.persistence.GenerationType;
13 import javax.persistence.Id;
14 import javax.persistence.Version;
15
16 import org.hibernate.annotations.Cache;
17 import org.hibernate.annotations.CacheConcurrencyStrategy;
18
19 import com.hack23.cia.model.core.impl.BaseEntity;
20
21 /***
22 * The Class GameBoard.
23 */
24 @Entity
25 @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
26 public class GameBoard extends BaseEntity {
27
28 /*** The Constant serialVersionUID. */
29 private static final long serialVersionUID = -1381199844545595026L;
30
31 /*** The id. */
32 private Long id;
33
34
35 /*** The players. */
36 private Set<Player> players;
37
38 /*** The version. */
39 private Long version=1L;
40
41 /***
42 * Instantiates a new game board.
43 */
44 public GameBoard() {
45 }
46
47
48
49
50
51
52 @Override
53 @Id
54 @GeneratedValue(strategy = GenerationType.AUTO)
55 public Long getId() {
56 return id;
57 }
58
59
60
61
62
63 @Override
64 @Version
65 public Long getVersion() {
66 return version;
67 }
68
69 /***
70 * Sets the id.
71 *
72 * @param id the new id
73 */
74 public void setId(final Long id) {
75 this.id = id;
76 }
77
78 /***
79 * Sets the version.
80 *
81 * @param version the new version
82 */
83 public void setVersion(final Long version) {
84 this.version = version;
85 }
86 }