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