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