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