1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.util;
17
18 import java.lang.reflect.InvocationTargetException;
19 import java.util.Collection;
20 import java.util.Collections;
21 import java.util.List;
22 import java.util.Map;
23
24 import org.kuali.rice.core.api.uif.RemotableQuickFinder.Builder;
25 import org.kuali.rice.krad.bo.BusinessObject;
26 import org.kuali.rice.krad.bo.DataObjectRelationship;
27 import org.kuali.rice.krad.datadictionary.RelationshipDefinition;
28 import org.kuali.rice.krad.document.Document;
29 import org.kuali.rice.krad.service.LegacyDataAdapter;
30 import org.kuali.rice.krad.util.ForeignKeyFieldsPopulationState;
31
32
33
34
35
36
37 public class MockLegacyDataAdapter implements LegacyDataAdapter {
38
39
40
41
42 @Override
43 public <T> T save(T dataObject) {
44 return dataObject;
45 }
46
47
48
49
50 @Override
51 public <T> T linkAndSave(T dataObject) {
52 return dataObject;
53 }
54
55
56
57
58 @Override
59 public <T> T saveDocument(T document) {
60 return document;
61 }
62
63
64
65
66 @Override
67 public <T> T findBySinglePrimaryKey(Class<T> clazz, Object primaryKey) {
68 return null;
69 }
70
71
72
73
74 @Override
75 public <T> T findByPrimaryKey(Class<T> clazz, Map<String, ?> primaryKeys) {
76 return null;
77 }
78
79
80
81
82 @Override
83 public void delete(Object dataObject) {
84 }
85
86
87
88
89 @Override
90 public void deleteMatching(Class<?> clazz, Map<String, ?> fieldValues) {
91 }
92
93
94
95
96 @Override
97 public <T> T retrieve(T dataObject) {
98 return dataObject;
99 }
100
101
102
103
104 @Override
105 public <T> Collection<T> findAll(Class<T> clazz) {
106 return Collections.emptyList();
107 }
108
109
110
111
112 @Override
113 public <T> Collection<T> findMatching(Class<T> clazz, Map<String, ?> fieldValues) {
114 return Collections.emptyList();
115 }
116
117
118
119
120
121 @Override
122 public <T> Collection<T> findMatchingOrderBy(Class<T> clazz, Map<String, ?> fieldValues, String sortField,
123 boolean sortAscending) {
124 return Collections.emptyList();
125 }
126
127
128
129
130 @Override
131 public Map<String, ?> getPrimaryKeyFieldValues(Object dataObject) {
132 return Collections.emptyMap();
133 }
134
135
136
137
138 @Override
139 public void retrieveNonKeyFields(Object persistableObject) {
140 }
141
142
143
144
145 @Override
146 public void retrieveReferenceObject(Object persistableObject, String referenceObjectName) {
147 }
148
149
150
151
152 @Override
153 public void refreshAllNonUpdatingReferences(Object persistableObject) {
154 }
155
156
157
158
159 @Override
160 public Object resolveProxy(Object o) {
161 return o;
162 }
163
164
165
166
167 @Override
168 public boolean isProxied(Object object) {
169 return false;
170 }
171
172
173
174
175
176 @Override
177 public <T> Collection<T> findCollectionBySearchHelper(Class<T> clazz, Map<String, String> formProps,
178 boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit) {
179 return Collections.emptyList();
180 }
181
182
183
184
185
186 @Override
187 public <T> Collection<T> findCollectionBySearchHelper(Class<T> clazz, Map<String, String> formProps,
188 List<String> wildcardAsLiteralPropertyNames, boolean unbounded,
189 boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit) {
190 return Collections.emptyList();
191 }
192
193
194
195
196 @Override
197 public <T> T findObjectBySearch(Class<T> clazz, Map<String, String> formProps) {
198 return null;
199 }
200
201
202
203
204
205 @Override
206 public boolean allPrimaryKeyValuesPresentAndNotWildcard(Class<?> boClass, Map<String, String> formProps) {
207 return false;
208 }
209
210
211
212
213 @Override
214 public List<String> listPrimaryKeyFieldNames(Class<?> clazz) {
215 return Collections.emptyList();
216 }
217
218
219
220
221
222 @Override
223 public Class<?> determineCollectionObjectType(Class<?> containingClass, String collectionPropertyName) {
224 return null;
225 }
226
227
228
229
230
231 @Override
232 public ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(Object bo, String referenceName) {
233 return null;
234 }
235
236
237
238
239 @Override
240 public Map<String, String> getForeignKeysForReference(Class<?> clazz, String attributeName) {
241 return Collections.emptyMap();
242 }
243
244
245
246
247 @Override
248 public boolean hasPrimaryKeyFieldValues(Object persistableObject) {
249 return false;
250 }
251
252
253
254
255 @Override
256 public boolean hasReference(Class<?> boClass, String referenceName) {
257 return false;
258 }
259
260
261
262
263 @Override
264 public boolean hasCollection(Class<?> boClass, String collectionName) {
265 return false;
266 }
267
268
269
270
271
272 @Override
273 public boolean isExtensionAttribute(Class<?> boClass, String attributePropertyName, Class<?> propertyType) {
274 return false;
275 }
276
277
278
279
280 @Override
281 public Class<?> getExtensionAttributeClass(Class<?> boClass, String attributePropertyName) {
282 return null;
283 }
284
285
286
287
288 @Override
289 public Map<String, ?> getPrimaryKeyFieldValuesDOMDS(Object dataObject) {
290 return null;
291 }
292
293
294
295
296 @Override
297 public boolean equalsByPrimaryKeys(Object do1, Object do2) {
298 return false;
299 }
300
301
302
303
304
305
306
307
308
309
310
311
312 @Override
313 public void materializeAllSubObjects(Object object) {
314 }
315
316
317
318
319 @Override
320 public Class<?> getPropertyType(Object object, String propertyName) {
321 return null;
322 }
323
324
325
326
327 @Override
328 public Object getExtension(
329 Class<?> businessObjectClass) throws InstantiationException, IllegalAccessException {
330 return null;
331 }
332
333
334
335
336
337 @Override
338 public void refreshReferenceObject(Object businessObject, String referenceObjectName) {
339 }
340
341
342
343
344 @Override
345 public boolean isLockable(Object object) {
346 return false;
347 }
348
349
350
351
352 @Override
353 public void verifyVersionNumber(Object dataObject) {
354 }
355
356
357
358
359 @Override
360 public Builder createQuickFinder(Class<?> containingClass, String attributeName) {
361 return null;
362 }
363
364
365
366
367 @Override
368 public boolean isReferenceUpdatable(Class<?> boClass, String referenceName) {
369 return false;
370 }
371
372
373
374
375 @Override
376 public Map<String, Class> listReferenceObjectFields(Class<?> boClass) {
377 return null;
378 }
379
380
381
382
383 @Override
384 public boolean isCollectionUpdatable(Class<?> boClass, String collectionName) {
385 return false;
386 }
387
388
389
390
391 @Override
392 public Map<String, Class> listCollectionObjectTypes(Class<?> boClass) {
393 return null;
394 }
395
396
397
398
399 @Override
400 public BusinessObject getReferenceIfExists(Object bo, String referenceName) {
401 return null;
402 }
403
404
405
406
407
408 @Override
409 public boolean allForeignKeyValuesPopulatedForReference(Object bo, String referenceName) {
410 return false;
411 }
412
413
414
415
416 @Override
417 public RelationshipDefinition getDictionaryRelationship(Class<?> c, String attributeName) {
418 return null;
419 }
420
421
422
423
424 @Override
425 public String getTitleAttribute(Class<?> dataObjectClass) {
426 return null;
427 }
428
429
430
431
432 @Override
433 public boolean areNotesSupported(Class<?> dataObjectClass) {
434 return false;
435 }
436
437
438
439
440 @Override
441 public String getDataObjectIdentifierString(Object dataObject) {
442 return null;
443 }
444
445
446
447
448
449 @Override
450 public Class<?> getInquiryObjectClassIfNotTitle(Object dataObject, String propertyName) {
451 return null;
452 }
453
454
455
456
457
458 @Override
459 public Map<String, String> getInquiryParameters(Object dataObject, List<String> keys, String propertyName) {
460 return Collections.emptyMap();
461 }
462
463
464
465
466 @Override
467 public boolean hasLocalLookup(Class<?> dataObjectClass) {
468 return false;
469 }
470
471
472
473
474 @Override
475 public boolean hasLocalInquiry(Class<?> dataObjectClass) {
476 return false;
477 }
478
479
480
481
482
483 @Override
484 public DataObjectRelationship getDataObjectRelationship(Object dataObject, Class<?> dataObjectClass,
485 String attributeName, String attributePrefix, boolean keysOnly, boolean supportsLookup,
486 boolean supportsInquiry) {
487 return null;
488 }
489
490
491
492
493 @Override
494 public boolean isPersistable(Class<?> dataObjectClass) {
495 return false;
496 }
497
498
499
500
501
502 @Override
503 public void setObjectPropertyDeep(Object bo, String propertyName, Class<?> type,
504 Object propertyValue) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
505 }
506
507
508
509
510 @Override
511 public Class<?> materializeClassForProxiedObject(Object object) {
512 return null;
513 }
514
515
516
517
518 @Override
519 public Object getNestedValue(Object bo, String fieldName) {
520 return null;
521 }
522
523
524
525
526 @Override
527 public Object createNewObjectFromClass(Class clazz) {
528 Object object = null;
529
530 try {
531 object = clazz.newInstance();
532 } catch (InstantiationException e) {
533
534 } catch (IllegalAccessException e) {
535
536 }
537
538 return object;
539 }
540
541
542
543
544 @Override
545 public boolean isNull(Object object) {
546 return false;
547 }
548
549
550
551
552
553 @Override
554 public void setObjectProperty(Object bo, String propertyName, Class propertyType,
555 Object propertyValue) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
556 }
557
558
559
560
561 @Override
562 public <T extends Document> T findByDocumentHeaderId(Class<T> documentClass, String id) {
563 return null;
564 }
565
566
567
568
569 @Override
570 public <T extends Document> List<T> findByDocumentHeaderIds(Class<T> documentClass, List<String> ids) {
571 return Collections.emptyList();
572 }
573
574 }