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