1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao;
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
31
32
33
34
35
36
37 public class SearchParameter
38 implements Serializable
39 {
40
41 public static final int LIKE_COMPARATOR = 0;
42
43 public static final int INSENSITIVE_LIKE_COMPARATOR = 1;
44
45 public static final int EQUAL_COMPARATOR = 2;
46
47 public static final int GREATER_THAN_OR_EQUAL_COMPARATOR = 3;
48
49 public static final int GREATER_THAN_COMPARATOR = 4;
50
51 public static final int LESS_THAN_OR_EQUAL_COMPARATOR = 5;
52
53 public static final int LESS_THAN_COMPARATOR = 6;
54
55 public static final int IN_COMPARATOR = 7;
56
57 public static final int NOT_EQUAL_COMPARATOR = 8;
58
59 public static final int NOT_NULL_COMPARATOR = 9;
60
61 public static final int NULL_COMPARATOR = 10;
62
63 public static final int NOT_IN_COMPARATOR = 11;
64
65 public static final int NOT_LIKE_COMPARATOR = 12;
66
67 public static final int NOT_INSENSITIVE_LIKE_COMPARATOR = 13;
68
69 public static final int EMPTY_COMPARATOR = 14;
70
71 public static final int NOT_EMPTY_COMPARATOR = 15;
72
73
74 public static final int ORDER_UNSET = -1;
75
76
77 public static final int ORDER_ASC = 0;
78
79
80 public static final int ORDER_DESC = 1;
81
82
83 public static final int MATCH_ANYWHERE = 0;
84
85 public static final int MATCH_START = 1;
86
87 public static final int MATCH_END = 2;
88
89 public static final int MATCH_EXACT = 3;
90
91
92
93
94
95
96 public SearchParameter(
97 String nameIn,
98 Object valueIn)
99 {
100 this(nameIn, valueIn, EQUAL_COMPARATOR);
101 }
102
103
104
105
106
107
108 public SearchParameter(
109 String nameIn,
110 int comparatorIn)
111 {
112 this(nameIn, null, comparatorIn);
113 }
114
115
116
117
118
119
120
121 public SearchParameter(
122 String nameIn,
123 Object valueIn,
124 int comparatorIn)
125 {
126 this(nameIn, valueIn, comparatorIn, MATCH_EXACT);
127 }
128
129
130
131
132
133
134
135
136 public SearchParameter(
137 String nameIn,
138 Object valueIn,
139 int comparatorIn,
140 int matchIn)
141 {
142 this(nameIn, valueIn, comparatorIn, matchIn, ORDER_UNSET);
143 }
144
145
146
147
148
149
150
151
152
153 public SearchParameter(
154 String nameIn,
155 Object valueIn,
156 int comparatorIn,
157 int matchIn,
158 int orderIn)
159 {
160 this(nameIn, valueIn, comparatorIn, matchIn, orderIn, false);
161 }
162
163
164
165
166
167
168
169
170
171
172 public SearchParameter(
173 String nameIn,
174 Object valueIn,
175 int comparatorIn,
176 int matchIn,
177 int orderIn,
178 boolean searchIfNullIn)
179 {
180 this.name = nameIn;
181 this.value = valueIn;
182 this.comparator = comparatorIn;
183 this.order = orderIn;
184 this.match = matchIn;
185 this.searchIfNull = searchIfNullIn;
186 }
187
188
189
190
191
192 public SearchParameter(SearchParameter otherBean)
193 {
194 if (otherBean != null)
195 {
196 this.name = otherBean.getName();
197 this.value = otherBean.getValue();
198 this.comparator = otherBean.getComparator();
199 this.order = otherBean.getOrder();
200 this.match = otherBean.getMatch();
201 this.searchIfNull = otherBean.isSearchIfNull();
202 }
203 }
204
205
206 private String name;
207
208
209
210
211
212 public String getName()
213 {
214 return this.name;
215 }
216
217
218
219
220 public void setName(String nameIn)
221 {
222 this.name = nameIn;
223 }
224
225 private Object value;
226
227
228
229
230
231 public Object getValue()
232 {
233 return this.value;
234 }
235
236
237
238
239 public void setValue(Object valueIn)
240 {
241 this.value = valueIn;
242 }
243
244 private int comparator = EQUAL_COMPARATOR;
245
246
247
248
249 public int getComparator()
250 {
251 return this.comparator;
252 }
253
254
255
256
257 public void setComparator(int comparatorIn)
258 {
259 this.comparator = comparatorIn;
260 }
261
262 private int order;
263
264
265
266
267
268 public int getOrder()
269 {
270 return this.order;
271 }
272
273
274
275
276 public void setOrder(int orderIn)
277 {
278 this.order = orderIn;
279 }
280
281 private boolean searchIfNull;
282
283
284
285
286
287 public boolean isSearchIfNull()
288 {
289 return this.searchIfNull;
290 }
291
292
293
294
295
296
297
298 public void setSearchIfNull(boolean searchIfNullIn)
299 {
300 this.searchIfNull = searchIfNullIn;
301 }
302
303 private int match;
304
305
306
307
308
309
310 public int getMatch()
311 {
312 return this.match;
313 }
314
315
316
317
318
319 public void setMatch(int matchIn)
320 {
321 this.match = matchIn;
322 }
323
324 private static final long serialVersionUID = 1L;
325 }