View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
4   */
5   
6   package com.hack23.cia.model.sweden.impl;
7   
8   import javax.persistence.Entity;
9   import javax.persistence.EnumType;
10  import javax.persistence.Enumerated;
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 VoteMetaData.
23   */
24  @Entity
25  @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
26  public class VoteMetaData extends BaseEntity {
27  
28  	/***
29  	 * The Enum Outcome.
30  	 */
31  	public enum Outcome {
32      	
33  	    /*** The Lost. */
34  		Lost,
35  
36  /*** The Won. */
37  Won;
38      }
39  
40  	
41  	/***
42  	 * The Enum PoliticalPartyBehavior.
43  	 */
44      public enum PoliticalPartyBehavior {
45      	
46  	    /*** The Loyal. */
47  		Loyal,
48  
49  /*** The Neutral. */
50  Neutral,
51  
52  /*** The Rebel. */
53  Rebel;
54      }    
55  
56      /***
57       * The Enum ProffessionalBehavior.
58       */
59      public enum ProffessionalBehavior {
60      	
61  	    /*** The Absent. */
62  		Absent,
63  
64  /*** The Present. */
65  Present;
66      }        
67      
68      /*** The Constant serialVersionUID. */
69  	private static final long serialVersionUID = 1L;           
70      
71      /*** The id. */
72      private Long id;
73  
74      /*** The outcome. */
75      private Outcome outcome;
76      
77      /*** The political party behavior. */
78      private PoliticalPartyBehavior politicalPartyBehavior;
79      
80      /*** The proffessional behavior. */
81      private ProffessionalBehavior proffessionalBehavior;
82      
83      /*** The version. */
84      private Long version=1L;
85  
86      /***
87       * Instantiates a new vote meta data.
88       */
89      public VoteMetaData() {
90  		super();
91  	}
92      
93  	/*
94       * (non-Javadoc)
95       * 
96       * @see com.hack23.cia.model.core.BaseEntity#getId()
97       */
98      @Override
99      @Id
100     @GeneratedValue(strategy = GenerationType.AUTO)
101     public Long getId() {
102         return id;
103     }
104 
105 
106     /***
107      * Gets the outcome.
108      *
109      * @return the outcome
110      */
111     @Enumerated(EnumType.STRING)
112 	public Outcome getOutcome() {
113 		return outcome;
114 	}
115 
116 
117     /***
118      * Gets the political party behavior.
119      *
120      * @return the political party behavior
121      */
122     @Enumerated(EnumType.STRING)
123 	public PoliticalPartyBehavior getPoliticalPartyBehavior() {
124 		return politicalPartyBehavior;
125 	}
126 
127 
128     /***
129      * Gets the proffessional behavior.
130      *
131      * @return the proffessional behavior
132      */
133     @Enumerated(EnumType.STRING)
134 	public ProffessionalBehavior getProffessionalBehavior() {
135 		return proffessionalBehavior;
136 	}
137 
138     /* (non-Javadoc)
139      * @see com.hack23.cia.model.core.BaseEntity#getVersion()
140      */
141     @Override
142     @Version
143     public Long getVersion() {
144         return version;
145     }
146 
147 	/***
148 	 * Sets the id.
149 	 *
150 	 * @param id the new id
151 	 */
152     public void setId(final Long id) {
153         this.id = id;
154     }
155 
156     /***
157      * Sets the outcome.
158      *
159      * @param outcome the new outcome
160      */
161 	public void setOutcome(final Outcome outcome) {
162 		this.outcome = outcome;
163 	}
164 
165 	/***
166 	 * Sets the political party behavior.
167 	 *
168 	 * @param politicalPartyBehavior the new political party behavior
169 	 */
170 	public void setPoliticalPartyBehavior(
171 			final PoliticalPartyBehavior politicalPartyBehavior) {
172 		this.politicalPartyBehavior = politicalPartyBehavior;
173 	}
174 
175     /***
176      * Sets the proffessional behavior.
177      *
178      * @param proffessionalBehavior the new proffessional behavior
179      */
180 	public void setProffessionalBehavior(final ProffessionalBehavior proffessionalBehavior) {
181 		this.proffessionalBehavior = proffessionalBehavior;
182 	}
183 
184 	/***
185 	 * Sets the version.
186 	 *
187 	 * @param version the new version
188 	 */
189     public void setVersion(final Long version) {
190         this.version = version;
191     }
192 
193 }