1
2
3
4
5
6 package com.hack23.cia.model.sweden.impl;
7
8 import java.util.Date;
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 Election.
23 */
24 @Entity
25 @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
26 public class Election extends BaseEntity {
27
28 /*** The Constant serialVersionUID. */
29 private static final long serialVersionUID = 1L;
30
31
32 /*** The id. */
33 private Long id;
34
35 /*** The name. */
36 private String name;
37
38 /*** The election date. */
39 private Date electionDate;
40
41 /*** The version. */
42 private Long version=1L;
43
44 /***
45 * Instantiates a new election.
46 */
47 public Election() {
48 super();
49 }
50
51
52
53
54
55
56 @Override
57 @Id
58 @GeneratedValue(strategy = GenerationType.AUTO)
59 public Long getId() {
60 return id;
61 }
62
63 /***
64 * Gets the name.
65 *
66 * @return the name
67 */
68 public String getName() {
69 return name;
70 }
71
72
73
74
75 @Override
76 @Version
77 public Long getVersion() {
78 return version;
79 }
80
81 /***
82 * Sets the id.
83 *
84 * @param id the new id
85 */
86 public void setId(final Long id) {
87 this.id = id;
88 }
89
90 /***
91 * Sets the name.
92 *
93 * @param name the new name
94 */
95 public void setName(final String name) {
96 this.name = name;
97 }
98
99 /***
100 * Sets the version.
101 *
102 * @param version the new version
103 */
104 public void setVersion(final Long version) {
105 this.version = version;
106 }
107
108 /***
109 * Gets the election date.
110 *
111 * @return the election date
112 */
113 public Date getElectionDate() {
114 return electionDate;
115 }
116
117 /***
118 * Sets the election date.
119 *
120 * @param electionDate the new election date
121 */
122 public void setElectionDate(final Date electionDate) {
123 this.electionDate = electionDate;
124 }
125 }