1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.service.impl;
17
18 import org.kuali.rice.krad.bo.DataObjectRelationship;
19 import org.kuali.rice.krad.bo.PersistableBusinessObject;
20 import org.kuali.rice.krad.service.PersistenceStructureService;
21 import org.kuali.rice.krad.util.ForeignKeyFieldsPopulationState;
22 import org.kuali.rice.krad.util.LegacyDataFramework;
23
24 import java.util.HashMap;
25 import java.util.List;
26 import java.util.Map;
27
28
29
30
31
32
33
34
35
36 @Deprecated
37 @LegacyDataFramework
38 public class PersistenceStructureServiceImpl extends PersistenceServiceImplBase implements PersistenceStructureService {
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 public static Map<Class, Class> referenceConversionMap = new HashMap<Class, Class>();
56
57 private PersistenceStructureService persistenceStructureServiceOjb;
58
59 public void setPersistenceStructureServiceOjb(PersistenceStructureService persistenceStructureServiceOjb) {
60 this.persistenceStructureServiceOjb = persistenceStructureServiceOjb;
61 }
62
63 private PersistenceStructureService getService(Class clazz) {
64
65
66
67 return persistenceStructureServiceOjb;
68 }
69
70
71
72
73
74 @Override
75 public boolean isPersistable(Class clazz) {
76 return getService(clazz).isPersistable(clazz);
77 }
78
79
80
81
82
83 @Override
84 public List getPrimaryKeys(Class clazz) {
85 return getService(clazz).getPrimaryKeys(clazz);
86 }
87
88
89
90
91
92 @Override
93 public List listFieldNames(Class clazz) {
94 return getService(clazz).listFieldNames(clazz);
95 }
96
97
98
99
100
101 @Override
102 public Object clearPrimaryKeyFields(Object persistableObject) {
103 return getService(persistableObject.getClass()).clearPrimaryKeyFields(persistableObject);
104 }
105
106
107
108
109
110
111 @Override
112 public List listPersistableSubclasses(Class superclazz) {
113 return getService(superclazz).listPersistableSubclasses(superclazz);
114 }
115
116
117
118
119
120
121 @Override
122 public Map<String, DataObjectRelationship> getRelationshipMetadata(Class persistableClass, String attributeName, String attributePrefix) {
123 return getService(persistableClass).getRelationshipMetadata(persistableClass, attributeName, attributePrefix);
124 }
125
126
127
128 @Override
129 public Map<String, DataObjectRelationship> getRelationshipMetadata(Class persistableClass, String attributeName) {
130 return getService(persistableClass).getRelationshipMetadata(persistableClass, attributeName);
131 }
132
133
134
135
136
137
138 @Override
139 public String getForeignKeyFieldName(Class persistableObjectClass, String attributeName, String pkName) {
140 return getService(persistableObjectClass).getForeignKeyFieldName(persistableObjectClass, attributeName, pkName);
141 }
142
143
144
145
146
147
148 @Override
149 public Map getReferencesForForeignKey(Class persistableObjectClass, String attributeName) {
150 return getService(persistableObjectClass).getReferencesForForeignKey(persistableObjectClass, attributeName);
151 }
152
153
154
155
156
157 @Override
158 public Map getForeignKeysForReference(Class clazz, String attributeName) {
159 return getService(clazz).getForeignKeysForReference(clazz, attributeName);
160 }
161
162
163 @Override
164 public Map<String, String> getInverseForeignKeysForCollection(Class boClass, String collectionName) {
165 return getService(boClass).getInverseForeignKeysForCollection(boClass, collectionName);
166 }
167
168
169
170
171
172 @Override
173 public Map getNestedForeignKeyMap(Class persistableObjectClass) {
174 return getService(persistableObjectClass).getNestedForeignKeyMap(persistableObjectClass);
175 }
176
177
178
179
180 @Override
181 public boolean hasPrimaryKeyFieldValues(Object persistableObject) {
182 return getService(persistableObject.getClass()).hasPrimaryKeyFieldValues(persistableObject);
183 }
184
185
186
187
188
189 @Override
190 public ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(PersistableBusinessObject bo, String referenceName) {
191 return getService(bo.getClass()).getForeignKeyFieldsPopulationState(bo, referenceName);
192 }
193
194
195
196
197
198 @Override
199 public Map<String, Class> listReferenceObjectFields(Class boClass) {
200 return getService(boClass).listReferenceObjectFields(boClass);
201 }
202
203
204 @Override
205 public Map<String, Class> listCollectionObjectTypes(Class boClass) {
206 return getService(boClass).listCollectionObjectTypes(boClass);
207 }
208
209 @Override
210 public Map<String, Class> listCollectionObjectTypes(PersistableBusinessObject bo) {
211 return getService(bo.getClass()).listCollectionObjectTypes(bo);
212 }
213
214
215
216
217 @Override
218 public Map<String, Class> listReferenceObjectFields(PersistableBusinessObject bo) {
219 return getService(bo.getClass()).listReferenceObjectFields(bo);
220 }
221
222
223 @Override
224 public boolean isReferenceUpdatable(Class boClass, String referenceName) {
225 return getService(boClass).isReferenceUpdatable(boClass, referenceName);
226 }
227
228
229 @Override
230 public boolean isCollectionUpdatable(Class boClass, String collectionName) {
231 return getService(boClass).isCollectionUpdatable(boClass, collectionName);
232 }
233
234
235 @Override
236 public boolean hasCollection(Class boClass, String collectionName) {
237 return getService(boClass).hasCollection(boClass, collectionName);
238 }
239
240
241 @Override
242 public boolean hasReference(Class boClass, String referenceName) {
243 return getService(boClass).hasReference(boClass, referenceName);
244 }
245
246
247
248
249
250
251 @Override
252 public String getTableName(
253 Class<? extends PersistableBusinessObject> boClass) {
254 return getService(boClass).getTableName(boClass);
255 }
256
257
258 }