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