KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > ejb > EMProxy


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.ejb;
13
14 import com.versant.core.jdo.VersantPMInternal;
15 import com.versant.core.jdo.VersantPersistenceManager;
16 import com.versant.core.jdo.LifecycleListener;
17 import com.versant.core.server.QueryResultWrapper;
18 import com.versant.core.server.CompiledQuery;
19 import com.versant.core.common.QueryResultContainer;
20 import com.versant.core.common.StatesReturned;
21 import com.versant.core.common.BindingSupportImpl;
22
23 import javax.jdo.Query;
24 import javax.jdo.Transaction;
25 import javax.jdo.Extent;
26 import javax.jdo.PersistenceManagerFactory;
27 import javax.jdo.spi.PersistenceCapable;
28 import java.sql.Connection JavaDoc;
29 import java.util.List JavaDoc;
30 import java.util.Collection JavaDoc;
31
32 /**
33  * Proxy instance to the real EntityManager.
34  */

35 public class EMProxy implements VersantPersistenceManager, VersantPMInternal {
36     private EntityManagerImp em;
37
38     public EMProxy(EntityManagerImp em) {
39         this.em = em;
40     }
41
42     public EntityManagerImp getEm() {
43         return em;
44     }
45
46     public void detach() {
47         em = null;
48     }
49
50     private void checkClosed() {
51         if (em == null) {
52             throw BindingSupportImpl.getInstance().invalidOperation(
53                     "The pm is closed");
54         }
55     }
56
57
58     public boolean isInterceptDfgFieldAccess() {
59         return false;
60     }
61
62     public void setInterceptDfgFieldAccess(boolean interceptDfgFieldAccess) {
63         //To change body of implemented methods use File | Settings | File Templates.
64
}
65
66     public void cancelQueryExecution() {
67         //To change body of implemented methods use File | Settings | File Templates.
68
}
69
70     public boolean isDirty() {
71         return em.isDirty();
72     }
73
74     public Object JavaDoc getObjectByIDString(String JavaDoc value, boolean toValidate) {
75         return null;
76     }
77
78     public Object JavaDoc newObjectIdInstance(Class JavaDoc pcClass, String JavaDoc str, boolean resolved) {
79         return null;
80     }
81
82     public Object JavaDoc getObjectByIDString(String JavaDoc value, boolean toValidate, boolean resolved) {
83         return null;
84     }
85
86     public void loadFetchGroup(Object JavaDoc pc, String JavaDoc name) {
87     }
88
89     public void flush() {
90         em.flush();
91     }
92
93     public void flush(boolean retainValues) {
94         em.flush();
95     }
96
97     public Connection JavaDoc getJdbcConnection(String JavaDoc datastore) {
98         return null;
99     }
100
101     public String JavaDoc getConnectionURL(String JavaDoc dataStore) {
102         return null;
103     }
104
105     public String JavaDoc getConnectionDriverName(String JavaDoc dataStore) {
106         return null;
107     }
108
109     public void makeTransientRecursive(Object JavaDoc pc) {
110     }
111
112     public List JavaDoc versantAllDirtyInstances() {
113         return em.versantAllDirtyInstances();
114     }
115
116     public void setDatastoreTxLocking(int mode) {
117         em.setDatastoreTxLocking(mode);
118     }
119
120     public int getDatastoreTxLocking() {
121         return 0; //To change body of implemented methods use File | Settings | File Templates.
122
}
123
124     public Object JavaDoc getObjectByIdFromCache(Object JavaDoc oid) {
125         return null; //To change body of implemented methods use File | Settings | File Templates.
126
}
127
128     public boolean isHollow(Object JavaDoc pc) {
129         return false; //To change body of implemented methods use File | Settings | File Templates.
130
}
131
132     public boolean hasIdentity(Object JavaDoc pc) {
133         return false; //To change body of implemented methods use File | Settings | File Templates.
134
}
135
136     public void logEvent(int level, String JavaDoc description, int ms) {
137         //To change body of implemented methods use File | Settings | File Templates.
138
}
139
140     public int getObjectsById(Object JavaDoc[] oids, int length, Object JavaDoc[] data, int stateFieldNo, int classMetaDataIndex) {
141         return 0; //To change body of implemented methods use File | Settings | File Templates.
142
}
143
144     public Query versantNewNamedQuery(Class JavaDoc cls, String JavaDoc queryName) {
145         return null; //To change body of implemented methods use File | Settings | File Templates.
146
}
147
148     public Collection JavaDoc versantDetachCopy(Collection JavaDoc pcs, String JavaDoc fetchGroup) {
149         return null; //To change body of implemented methods use File | Settings | File Templates.
150
}
151
152     public boolean isCheckModelConsistencyOnCommit() {
153         return false; //To change body of implemented methods use File | Settings | File Templates.
154
}
155
156     public void setCheckModelConsistencyOnCommit(boolean on) {
157         //To change body of implemented methods use File | Settings | File Templates.
158
}
159
160     public void checkModelConsistency() {
161         //To change body of implemented methods use File | Settings | File Templates.
162
}
163
164     public Collection JavaDoc versantAttachCopy(Collection JavaDoc detached, boolean makeTransactional) {
165         return null; //To change body of implemented methods use File | Settings | File Templates.
166
}
167
168     public Collection JavaDoc versantAttachCopy(Collection JavaDoc detached, boolean makeTransactional, boolean shallow) {
169         return null; //To change body of implemented methods use File | Settings | File Templates.
170
}
171
172     public void setPmCacheRefType(Object JavaDoc pc, int type) {
173         //To change body of implemented methods use File | Settings | File Templates.
174
}
175
176     public void setPmCacheRefType(Object JavaDoc[] pcs, int type) {
177         //To change body of implemented methods use File | Settings | File Templates.
178
}
179
180     public void setPmCacheRefType(Collection JavaDoc col, int type) {
181         //To change body of implemented methods use File | Settings | File Templates.
182
}
183
184     public void setPmCacheRefType(int type) {
185         //To change body of implemented methods use File | Settings | File Templates.
186
}
187
188     public int getPmCacheRefType() {
189         return 0; //To change body of implemented methods use File | Settings | File Templates.
190
}
191
192     public void setRetainConnectionInOptTx(boolean on) {
193         //To change body of implemented methods use File | Settings | File Templates.
194
}
195
196     public void evictFromL2CacheAfterCommit(Object JavaDoc o) {
197         //To change body of implemented methods use File | Settings | File Templates.
198
}
199
200     public void evictAllFromL2CacheAfterCommit(Object JavaDoc[] a) {
201         //To change body of implemented methods use File | Settings | File Templates.
202
}
203
204     public void evictAllFromL2CacheAfterCommit(Collection JavaDoc c) {
205         //To change body of implemented methods use File | Settings | File Templates.
206
}
207
208     public void evictAllFromL2CacheAfterCommit(Class JavaDoc cls, boolean includeSubclasses) {
209         //To change body of implemented methods use File | Settings | File Templates.
210
}
211
212     public void evictAllFromL2CacheAfterCommit() {
213         //To change body of implemented methods use File | Settings | File Templates.
214
}
215
216     public Object JavaDoc getOptimisticLockingValue(Object JavaDoc o) {
217         return null; //To change body of implemented methods use File | Settings | File Templates.
218
}
219
220     public void addLifecycleListener(LifecycleListener listener, Class JavaDoc[] classes) {
221         //To change body of implemented methods use File | Settings | File Templates.
222
}
223
224     public void removeLifecycleListener(LifecycleListener listener) {
225         //To change body of implemented methods use File | Settings | File Templates.
226
}
227
228     public boolean isClosed() {
229         return false; //To change body of implemented methods use File | Settings | File Templates.
230
}
231
232     public void close() {
233         //To change body of implemented methods use File | Settings | File Templates.
234
}
235
236     public Transaction currentTransaction() {
237         return null; //To change body of implemented methods use File | Settings | File Templates.
238
}
239
240     public void evict(Object JavaDoc pc) {
241         //To change body of implemented methods use File | Settings | File Templates.
242
}
243
244     public void evictAll(Object JavaDoc[] pcs) {
245         //To change body of implemented methods use File | Settings | File Templates.
246
}
247
248     public void evictAll(Collection JavaDoc pcs) {
249         //To change body of implemented methods use File | Settings | File Templates.
250
}
251
252     public void evictAll() {
253         //To change body of implemented methods use File | Settings | File Templates.
254
}
255
256     public void refresh(Object JavaDoc pc) {
257         //To change body of implemented methods use File | Settings | File Templates.
258
}
259
260     public void refreshAll(Object JavaDoc[] pcs) {
261         //To change body of implemented methods use File | Settings | File Templates.
262
}
263
264     public void refreshAll(Collection JavaDoc pcs) {
265         //To change body of implemented methods use File | Settings | File Templates.
266
}
267
268     public void refreshAll() {
269         //To change body of implemented methods use File | Settings | File Templates.
270
}
271
272     public Query newQuery() {
273         return null; //To change body of implemented methods use File | Settings | File Templates.
274
}
275
276     public Query newQuery(Object JavaDoc compiled) {
277         return null; //To change body of implemented methods use File | Settings | File Templates.
278
}
279
280     public Query newQuery(String JavaDoc language, Object JavaDoc query) {
281         return null; //To change body of implemented methods use File | Settings | File Templates.
282
}
283
284     public Query newQuery(Class JavaDoc cls) {
285         return null; //To change body of implemented methods use File | Settings | File Templates.
286
}
287
288     public Query newQuery(Extent cln) {
289         return null; //To change body of implemented methods use File | Settings | File Templates.
290
}
291
292     public Query newQuery(Class JavaDoc cls, Collection JavaDoc cln) {
293         return null; //To change body of implemented methods use File | Settings | File Templates.
294
}
295
296     public Query newQuery(Class JavaDoc cls, String JavaDoc filter) {
297         return null; //To change body of implemented methods use File | Settings | File Templates.
298
}
299
300     public Query newQuery(Class JavaDoc cls, Collection JavaDoc cln, String JavaDoc filter) {
301         return null; //To change body of implemented methods use File | Settings | File Templates.
302
}
303
304     public Query newQuery(Extent cln, String JavaDoc filter) {
305         return null; //To change body of implemented methods use File | Settings | File Templates.
306
}
307
308     public Extent getExtent(Class JavaDoc persistenceCapableClass, boolean subclasses) {
309         return null; //To change body of implemented methods use File | Settings | File Templates.
310
}
311
312     public Object JavaDoc getObjectById(Object JavaDoc oid, boolean validate) {
313         return em.getObjectById(oid, validate);
314     }
315
316     public Object JavaDoc getObjectId(Object JavaDoc pc) {
317         return null; //To change body of implemented methods use File | Settings | File Templates.
318
}
319
320     public Object JavaDoc getTransactionalObjectId(Object JavaDoc pc) {
321         return null; //To change body of implemented methods use File | Settings | File Templates.
322
}
323
324     public Object JavaDoc newObjectIdInstance(Class JavaDoc pcClass, String JavaDoc str) {
325         return null; //To change body of implemented methods use File | Settings | File Templates.
326
}
327
328     public void makePersistent(Object JavaDoc pc) {
329         //To change body of implemented methods use File | Settings | File Templates.
330
}
331
332     public void makePersistentAll(Object JavaDoc[] pcs) {
333         //To change body of implemented methods use File | Settings | File Templates.
334
}
335
336     public void makePersistentAll(Collection JavaDoc pcs) {
337         //To change body of implemented methods use File | Settings | File Templates.
338
}
339
340     public void deletePersistent(Object JavaDoc pc) {
341         //To change body of implemented methods use File | Settings | File Templates.
342
}
343
344     public void deletePersistentAll(Object JavaDoc[] pcs) {
345         //To change body of implemented methods use File | Settings | File Templates.
346
}
347
348     public void deletePersistentAll(Collection JavaDoc pcs) {
349         //To change body of implemented methods use File | Settings | File Templates.
350
}
351
352     public void makeTransient(Object JavaDoc pc) {
353         //To change body of implemented methods use File | Settings | File Templates.
354
}
355
356     public void makeTransientAll(Object JavaDoc[] pcs) {
357         //To change body of implemented methods use File | Settings | File Templates.
358
}
359
360     public void makeTransientAll(Collection JavaDoc pcs) {
361         //To change body of implemented methods use File | Settings | File Templates.
362
}
363
364     public void makeTransactional(Object JavaDoc pc) {
365         //To change body of implemented methods use File | Settings | File Templates.
366
}
367
368     public void makeTransactionalAll(Object JavaDoc[] pcs) {
369         //To change body of implemented methods use File | Settings | File Templates.
370
}
371
372     public void makeTransactionalAll(Collection JavaDoc pcs) {
373         //To change body of implemented methods use File | Settings | File Templates.
374
}
375
376     public void makeNontransactional(Object JavaDoc pc) {
377         //To change body of implemented methods use File | Settings | File Templates.
378
}
379
380     public void makeNontransactionalAll(Object JavaDoc[] pcs) {
381         //To change body of implemented methods use File | Settings | File Templates.
382
}
383
384     public void makeNontransactionalAll(Collection JavaDoc pcs) {
385         //To change body of implemented methods use File | Settings | File Templates.
386
}
387
388     public void retrieve(Object JavaDoc pc) {
389         //To change body of implemented methods use File | Settings | File Templates.
390
}
391
392     public void retrieveAll(Collection JavaDoc pcs) {
393         //To change body of implemented methods use File | Settings | File Templates.
394
}
395
396     public void retrieveAll(Collection JavaDoc pcs, boolean DFGOnly) {
397         //To change body of implemented methods use File | Settings | File Templates.
398
}
399
400     public void retrieveAll(Object JavaDoc[] pcs) {
401         //To change body of implemented methods use File | Settings | File Templates.
402
}
403
404     public void retrieveAll(Object JavaDoc[] pcs, boolean DFGOnly) {
405         //To change body of implemented methods use File | Settings | File Templates.
406
}
407
408     public void setUserObject(Object JavaDoc o) {
409         //To change body of implemented methods use File | Settings | File Templates.
410
}
411
412     public Object JavaDoc getUserObject() {
413         return null; //To change body of implemented methods use File | Settings | File Templates.
414
}
415
416     public PersistenceManagerFactory getPersistenceManagerFactory() {
417         return null; //To change body of implemented methods use File | Settings | File Templates.
418
}
419
420     public Class JavaDoc getObjectIdClass(Class JavaDoc cls) {
421         return null; //To change body of implemented methods use File | Settings | File Templates.
422
}
423
424     public void setMultithreaded(boolean flag) {
425         //To change body of implemented methods use File | Settings | File Templates.
426
}
427
428     public boolean getMultithreaded() {
429         return false;
430     }
431
432     public void setIgnoreCache(boolean flag) {
433         //To change body of implemented methods use File | Settings | File Templates.
434
}
435
436     public boolean getIgnoreCache() {
437         return false; //To change body of implemented methods use File | Settings | File Templates.
438
}
439
440     public QueryResultWrapper executeQuery(CompiledQuery cq, Object JavaDoc[] params) {
441         return null; //To change body of implemented methods use File | Settings | File Templates.
442
}
443
444     public QueryResultContainer getNextQueryResult(QueryResultWrapper aQrs, int skipAmount) {
445         return null; //To change body of implemented methods use File | Settings | File Templates.
446
}
447
448     public void closeQuery(QueryResultWrapper qrw) {
449         //To change body of implemented methods use File | Settings | File Templates.
450
}
451
452     public void flushIfDepOn(int[] bits) {
453         em.flushIfDepOn(bits);
454     }
455
456
457
458
459     public void processLocalCacheReferenceQueue() {
460     }
461
462     public void addToCache(StatesReturned container) {
463         em.addToCache(container);
464     }
465
466     public QueryResultContainer getAbsolute(QueryResultWrapper qrsIF, int index, int fetchAmount) {
467         return null;
468     }
469
470     public int getResultCount(QueryResultWrapper qrsIF) {
471         return 0;
472     }
473
474     public int getQueryRowCount(CompiledQuery cq, Object JavaDoc[] params) {
475         return 0;
476     }
477
478     public QueryResultContainer getAllQueryResults(CompiledQuery cq, Object JavaDoc[] params) {
479         return em.getStorageManager().executeQueryAll(em, null, cq, params);
480     }
481
482     public void setMasterOnDetail(PersistenceCapable detail, int managedFieldNo, PersistenceCapable master, boolean removeFromCurrentMaster) {
483     }
484
485     public Object JavaDoc getObjectField(PersistenceCapable pc, int fieldNo) {
486         return null;
487     }
488 }
489
Popular Tags