1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.administration.strategy;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 import java.io.Serializable;
29 import java.sql.Timestamp;
30 import java.util.Date;
31
32
33
34
35
36 public abstract class AppliedPeriod
37 implements Serializable, Comparable<AppliedPeriod>
38 {
39
40
41
42 private static final long serialVersionUID = 252077637755485187L;
43
44 private AppliedPeriodPK appliedPeriodPk;
45
46
47
48
49
50 public AppliedPeriodPK getAppliedPeriodPk()
51 {
52 return this.appliedPeriodPk;
53 }
54
55
56
57
58
59 public void setAppliedPeriodPk(AppliedPeriodPK appliedPeriodPkIn) {
60 this.appliedPeriodPk = appliedPeriodPkIn;
61 }
62
63
64
65
66
67
68 public Date getAppliedPeriodStartDt()
69 {
70 return this.getAppliedPeriodPk().getAppliedPeriodStartDt();
71 }
72
73
74
75
76
77 public void setAppliedPeriodStartDt(Date appliedPeriodStartDtIn)
78 {
79 this.getAppliedPeriodPk().setAppliedPeriodStartDt(appliedPeriodStartDtIn);
80 }
81
82 private Date appliedPeriodEndDt;
83
84
85
86
87
88 public Date getAppliedPeriodEndDt()
89 {
90 return this.appliedPeriodEndDt;
91 }
92
93
94
95
96
97 public void setAppliedPeriodEndDt(Date appliedPeriodEndDtIn)
98 {
99 this.appliedPeriodEndDt = appliedPeriodEndDtIn;
100 }
101
102 private Timestamp updateDt;
103
104
105
106
107
108 public Timestamp getUpdateDt()
109 {
110 return this.updateDt;
111 }
112
113
114
115
116
117 public void setUpdateDt(Timestamp updateDtIn)
118 {
119 this.updateDt = updateDtIn;
120 }
121
122
123 private AppliedStrategy appliedStrategy;
124
125
126
127
128
129 public AppliedStrategy getAppliedStrategy()
130 {
131 return this.appliedStrategy;
132 }
133
134
135
136
137
138 public void setAppliedStrategy(AppliedStrategy appliedStrategyIn)
139 {
140 this.appliedStrategy = appliedStrategyIn;
141 }
142
143
144
145
146
147 @Override
148 public boolean equals(Object object)
149 {
150 if (this == object)
151 {
152 return true;
153 }
154 if (!(object instanceof AppliedPeriod))
155 {
156 return false;
157 }
158 final AppliedPeriod that = (AppliedPeriod)object;
159 if (this.appliedPeriodPk == null || that.appliedPeriodPk == null || !this.appliedPeriodPk.equals(that.appliedPeriodPk))
160 {
161 return false;
162 }
163 return true;
164 }
165
166
167
168
169 @Override
170 public int hashCode()
171 {
172 int hashCode = 0;
173 hashCode = 29 * hashCode + (this.appliedPeriodPk == null ? 0 : this.appliedPeriodPk.hashCode());
174
175 return hashCode;
176 }
177
178
179
180
181 public static final class Factory
182 {
183
184
185
186
187 public static AppliedPeriod newInstance()
188 {
189 return new AppliedPeriodImpl();
190 }
191
192
193
194
195
196
197
198
199 public static AppliedPeriod newInstance(Date appliedPeriodEndDt, AppliedStrategy appliedStrategy)
200 {
201 final AppliedPeriod entity = new AppliedPeriodImpl();
202 entity.setAppliedPeriodEndDt(appliedPeriodEndDt);
203 entity.setAppliedStrategy(appliedStrategy);
204 return entity;
205 }
206
207
208
209
210
211
212
213
214
215 public static AppliedPeriod newInstance(Date appliedPeriodEndDt, Timestamp updateDt, AppliedStrategy appliedStrategy)
216 {
217 final AppliedPeriod entity = new AppliedPeriodImpl();
218 entity.setAppliedPeriodEndDt(appliedPeriodEndDt);
219 entity.setUpdateDt(updateDt);
220 entity.setAppliedStrategy(appliedStrategy);
221 return entity;
222 }
223 }
224
225
226
227
228 public int compareTo(AppliedPeriod o)
229 {
230 int cmp = 0;
231 if (this.getAppliedPeriodPk() != null)
232 {
233 cmp = this.getAppliedPeriodPk().compareTo(o.getAppliedPeriodPk());
234 }
235 else
236 {
237 if (this.getAppliedPeriodEndDt() != null)
238 {
239 cmp = (cmp != 0 ? cmp : this.getAppliedPeriodEndDt().compareTo(o.getAppliedPeriodEndDt()));
240 }
241 if (this.getUpdateDt() != null)
242 {
243 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
244 }
245 }
246 return cmp;
247 }
248
249
250 }