001: /*
002: * Copyright (c) 1998 - 2005 Versant Corporation
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * Versant Corporation - initial API and implementation
010: */
011: package com.versant.core.ejb;
012:
013: import com.versant.core.jdo.VersantPMInternal;
014: import com.versant.core.jdo.VersantPersistenceManager;
015: import com.versant.core.jdo.LifecycleListener;
016: import com.versant.core.server.QueryResultWrapper;
017: import com.versant.core.server.CompiledQuery;
018: import com.versant.core.common.QueryResultContainer;
019: import com.versant.core.common.StatesReturned;
020: import com.versant.core.common.BindingSupportImpl;
021:
022: import javax.jdo.Query;
023: import javax.jdo.Transaction;
024: import javax.jdo.Extent;
025: import javax.jdo.PersistenceManagerFactory;
026: import javax.jdo.spi.PersistenceCapable;
027: import java.sql.Connection;
028: import java.util.List;
029: import java.util.Collection;
030:
031: /**
032: * Proxy instance to the real EntityManager.
033: */
034: public class EMProxy implements VersantPersistenceManager,
035: VersantPMInternal {
036: private EntityManagerImp em;
037:
038: public EMProxy(EntityManagerImp em) {
039: this .em = em;
040: }
041:
042: public EntityManagerImp getEm() {
043: return em;
044: }
045:
046: public void detach() {
047: em = null;
048: }
049:
050: private void checkClosed() {
051: if (em == null) {
052: throw BindingSupportImpl.getInstance().invalidOperation(
053: "The pm is closed");
054: }
055: }
056:
057: public boolean isInterceptDfgFieldAccess() {
058: return false;
059: }
060:
061: public void setInterceptDfgFieldAccess(
062: boolean interceptDfgFieldAccess) {
063: //To change body of implemented methods use File | Settings | File Templates.
064: }
065:
066: public void cancelQueryExecution() {
067: //To change body of implemented methods use File | Settings | File Templates.
068: }
069:
070: public boolean isDirty() {
071: return em.isDirty();
072: }
073:
074: public Object getObjectByIDString(String value, boolean toValidate) {
075: return null;
076: }
077:
078: public Object newObjectIdInstance(Class pcClass, String str,
079: boolean resolved) {
080: return null;
081: }
082:
083: public Object getObjectByIDString(String value, boolean toValidate,
084: boolean resolved) {
085: return null;
086: }
087:
088: public void loadFetchGroup(Object pc, String name) {
089: }
090:
091: public void flush() {
092: em.flush();
093: }
094:
095: public void flush(boolean retainValues) {
096: em.flush();
097: }
098:
099: public Connection getJdbcConnection(String datastore) {
100: return null;
101: }
102:
103: public String getConnectionURL(String dataStore) {
104: return null;
105: }
106:
107: public String getConnectionDriverName(String dataStore) {
108: return null;
109: }
110:
111: public void makeTransientRecursive(Object pc) {
112: }
113:
114: public List versantAllDirtyInstances() {
115: return em.versantAllDirtyInstances();
116: }
117:
118: public void setDatastoreTxLocking(int mode) {
119: em.setDatastoreTxLocking(mode);
120: }
121:
122: public int getDatastoreTxLocking() {
123: return 0; //To change body of implemented methods use File | Settings | File Templates.
124: }
125:
126: public Object getObjectByIdFromCache(Object oid) {
127: return null; //To change body of implemented methods use File | Settings | File Templates.
128: }
129:
130: public boolean isHollow(Object pc) {
131: return false; //To change body of implemented methods use File | Settings | File Templates.
132: }
133:
134: public boolean hasIdentity(Object pc) {
135: return false; //To change body of implemented methods use File | Settings | File Templates.
136: }
137:
138: public void logEvent(int level, String description, int ms) {
139: //To change body of implemented methods use File | Settings | File Templates.
140: }
141:
142: public int getObjectsById(Object[] oids, int length, Object[] data,
143: int stateFieldNo, int classMetaDataIndex) {
144: return 0; //To change body of implemented methods use File | Settings | File Templates.
145: }
146:
147: public Query versantNewNamedQuery(Class cls, String queryName) {
148: return null; //To change body of implemented methods use File | Settings | File Templates.
149: }
150:
151: public Collection versantDetachCopy(Collection pcs,
152: String fetchGroup) {
153: return null; //To change body of implemented methods use File | Settings | File Templates.
154: }
155:
156: public boolean isCheckModelConsistencyOnCommit() {
157: return false; //To change body of implemented methods use File | Settings | File Templates.
158: }
159:
160: public void setCheckModelConsistencyOnCommit(boolean on) {
161: //To change body of implemented methods use File | Settings | File Templates.
162: }
163:
164: public void checkModelConsistency() {
165: //To change body of implemented methods use File | Settings | File Templates.
166: }
167:
168: public Collection versantAttachCopy(Collection detached,
169: boolean makeTransactional) {
170: return null; //To change body of implemented methods use File | Settings | File Templates.
171: }
172:
173: public Collection versantAttachCopy(Collection detached,
174: boolean makeTransactional, boolean shallow) {
175: return null; //To change body of implemented methods use File | Settings | File Templates.
176: }
177:
178: public void setPmCacheRefType(Object pc, int type) {
179: //To change body of implemented methods use File | Settings | File Templates.
180: }
181:
182: public void setPmCacheRefType(Object[] pcs, int type) {
183: //To change body of implemented methods use File | Settings | File Templates.
184: }
185:
186: public void setPmCacheRefType(Collection col, int type) {
187: //To change body of implemented methods use File | Settings | File Templates.
188: }
189:
190: public void setPmCacheRefType(int type) {
191: //To change body of implemented methods use File | Settings | File Templates.
192: }
193:
194: public int getPmCacheRefType() {
195: return 0; //To change body of implemented methods use File | Settings | File Templates.
196: }
197:
198: public void setRetainConnectionInOptTx(boolean on) {
199: //To change body of implemented methods use File | Settings | File Templates.
200: }
201:
202: public void evictFromL2CacheAfterCommit(Object o) {
203: //To change body of implemented methods use File | Settings | File Templates.
204: }
205:
206: public void evictAllFromL2CacheAfterCommit(Object[] a) {
207: //To change body of implemented methods use File | Settings | File Templates.
208: }
209:
210: public void evictAllFromL2CacheAfterCommit(Collection c) {
211: //To change body of implemented methods use File | Settings | File Templates.
212: }
213:
214: public void evictAllFromL2CacheAfterCommit(Class cls,
215: boolean includeSubclasses) {
216: //To change body of implemented methods use File | Settings | File Templates.
217: }
218:
219: public void evictAllFromL2CacheAfterCommit() {
220: //To change body of implemented methods use File | Settings | File Templates.
221: }
222:
223: public Object getOptimisticLockingValue(Object o) {
224: return null; //To change body of implemented methods use File | Settings | File Templates.
225: }
226:
227: public void addLifecycleListener(LifecycleListener listener,
228: Class[] classes) {
229: //To change body of implemented methods use File | Settings | File Templates.
230: }
231:
232: public void removeLifecycleListener(LifecycleListener listener) {
233: //To change body of implemented methods use File | Settings | File Templates.
234: }
235:
236: public boolean isClosed() {
237: return false; //To change body of implemented methods use File | Settings | File Templates.
238: }
239:
240: public void close() {
241: //To change body of implemented methods use File | Settings | File Templates.
242: }
243:
244: public Transaction currentTransaction() {
245: return null; //To change body of implemented methods use File | Settings | File Templates.
246: }
247:
248: public void evict(Object pc) {
249: //To change body of implemented methods use File | Settings | File Templates.
250: }
251:
252: public void evictAll(Object[] pcs) {
253: //To change body of implemented methods use File | Settings | File Templates.
254: }
255:
256: public void evictAll(Collection pcs) {
257: //To change body of implemented methods use File | Settings | File Templates.
258: }
259:
260: public void evictAll() {
261: //To change body of implemented methods use File | Settings | File Templates.
262: }
263:
264: public void refresh(Object pc) {
265: //To change body of implemented methods use File | Settings | File Templates.
266: }
267:
268: public void refreshAll(Object[] pcs) {
269: //To change body of implemented methods use File | Settings | File Templates.
270: }
271:
272: public void refreshAll(Collection pcs) {
273: //To change body of implemented methods use File | Settings | File Templates.
274: }
275:
276: public void refreshAll() {
277: //To change body of implemented methods use File | Settings | File Templates.
278: }
279:
280: public Query newQuery() {
281: return null; //To change body of implemented methods use File | Settings | File Templates.
282: }
283:
284: public Query newQuery(Object compiled) {
285: return null; //To change body of implemented methods use File | Settings | File Templates.
286: }
287:
288: public Query newQuery(String language, Object query) {
289: return null; //To change body of implemented methods use File | Settings | File Templates.
290: }
291:
292: public Query newQuery(Class cls) {
293: return null; //To change body of implemented methods use File | Settings | File Templates.
294: }
295:
296: public Query newQuery(Extent cln) {
297: return null; //To change body of implemented methods use File | Settings | File Templates.
298: }
299:
300: public Query newQuery(Class cls, Collection cln) {
301: return null; //To change body of implemented methods use File | Settings | File Templates.
302: }
303:
304: public Query newQuery(Class cls, String filter) {
305: return null; //To change body of implemented methods use File | Settings | File Templates.
306: }
307:
308: public Query newQuery(Class cls, Collection cln, String filter) {
309: return null; //To change body of implemented methods use File | Settings | File Templates.
310: }
311:
312: public Query newQuery(Extent cln, String filter) {
313: return null; //To change body of implemented methods use File | Settings | File Templates.
314: }
315:
316: public Extent getExtent(Class persistenceCapableClass,
317: boolean subclasses) {
318: return null; //To change body of implemented methods use File | Settings | File Templates.
319: }
320:
321: public Object getObjectById(Object oid, boolean validate) {
322: return em.getObjectById(oid, validate);
323: }
324:
325: public Object getObjectId(Object pc) {
326: return null; //To change body of implemented methods use File | Settings | File Templates.
327: }
328:
329: public Object getTransactionalObjectId(Object pc) {
330: return null; //To change body of implemented methods use File | Settings | File Templates.
331: }
332:
333: public Object newObjectIdInstance(Class pcClass, String str) {
334: return null; //To change body of implemented methods use File | Settings | File Templates.
335: }
336:
337: public void makePersistent(Object pc) {
338: //To change body of implemented methods use File | Settings | File Templates.
339: }
340:
341: public void makePersistentAll(Object[] pcs) {
342: //To change body of implemented methods use File | Settings | File Templates.
343: }
344:
345: public void makePersistentAll(Collection pcs) {
346: //To change body of implemented methods use File | Settings | File Templates.
347: }
348:
349: public void deletePersistent(Object pc) {
350: //To change body of implemented methods use File | Settings | File Templates.
351: }
352:
353: public void deletePersistentAll(Object[] pcs) {
354: //To change body of implemented methods use File | Settings | File Templates.
355: }
356:
357: public void deletePersistentAll(Collection pcs) {
358: //To change body of implemented methods use File | Settings | File Templates.
359: }
360:
361: public void makeTransient(Object pc) {
362: //To change body of implemented methods use File | Settings | File Templates.
363: }
364:
365: public void makeTransientAll(Object[] pcs) {
366: //To change body of implemented methods use File | Settings | File Templates.
367: }
368:
369: public void makeTransientAll(Collection pcs) {
370: //To change body of implemented methods use File | Settings | File Templates.
371: }
372:
373: public void makeTransactional(Object pc) {
374: //To change body of implemented methods use File | Settings | File Templates.
375: }
376:
377: public void makeTransactionalAll(Object[] pcs) {
378: //To change body of implemented methods use File | Settings | File Templates.
379: }
380:
381: public void makeTransactionalAll(Collection pcs) {
382: //To change body of implemented methods use File | Settings | File Templates.
383: }
384:
385: public void makeNontransactional(Object pc) {
386: //To change body of implemented methods use File | Settings | File Templates.
387: }
388:
389: public void makeNontransactionalAll(Object[] pcs) {
390: //To change body of implemented methods use File | Settings | File Templates.
391: }
392:
393: public void makeNontransactionalAll(Collection pcs) {
394: //To change body of implemented methods use File | Settings | File Templates.
395: }
396:
397: public void retrieve(Object pc) {
398: //To change body of implemented methods use File | Settings | File Templates.
399: }
400:
401: public void retrieveAll(Collection pcs) {
402: //To change body of implemented methods use File | Settings | File Templates.
403: }
404:
405: public void retrieveAll(Collection pcs, boolean DFGOnly) {
406: //To change body of implemented methods use File | Settings | File Templates.
407: }
408:
409: public void retrieveAll(Object[] pcs) {
410: //To change body of implemented methods use File | Settings | File Templates.
411: }
412:
413: public void retrieveAll(Object[] pcs, boolean DFGOnly) {
414: //To change body of implemented methods use File | Settings | File Templates.
415: }
416:
417: public void setUserObject(Object o) {
418: //To change body of implemented methods use File | Settings | File Templates.
419: }
420:
421: public Object getUserObject() {
422: return null; //To change body of implemented methods use File | Settings | File Templates.
423: }
424:
425: public PersistenceManagerFactory getPersistenceManagerFactory() {
426: return null; //To change body of implemented methods use File | Settings | File Templates.
427: }
428:
429: public Class getObjectIdClass(Class cls) {
430: return null; //To change body of implemented methods use File | Settings | File Templates.
431: }
432:
433: public void setMultithreaded(boolean flag) {
434: //To change body of implemented methods use File | Settings | File Templates.
435: }
436:
437: public boolean getMultithreaded() {
438: return false;
439: }
440:
441: public void setIgnoreCache(boolean flag) {
442: //To change body of implemented methods use File | Settings | File Templates.
443: }
444:
445: public boolean getIgnoreCache() {
446: return false; //To change body of implemented methods use File | Settings | File Templates.
447: }
448:
449: public QueryResultWrapper executeQuery(CompiledQuery cq,
450: Object[] params) {
451: return null; //To change body of implemented methods use File | Settings | File Templates.
452: }
453:
454: public QueryResultContainer getNextQueryResult(
455: QueryResultWrapper aQrs, int skipAmount) {
456: return null; //To change body of implemented methods use File | Settings | File Templates.
457: }
458:
459: public void closeQuery(QueryResultWrapper qrw) {
460: //To change body of implemented methods use File | Settings | File Templates.
461: }
462:
463: public void flushIfDepOn(int[] bits) {
464: em.flushIfDepOn(bits);
465: }
466:
467: public void processLocalCacheReferenceQueue() {
468: }
469:
470: public void addToCache(StatesReturned container) {
471: em.addToCache(container);
472: }
473:
474: public QueryResultContainer getAbsolute(QueryResultWrapper qrsIF,
475: int index, int fetchAmount) {
476: return null;
477: }
478:
479: public int getResultCount(QueryResultWrapper qrsIF) {
480: return 0;
481: }
482:
483: public int getQueryRowCount(CompiledQuery cq, Object[] params) {
484: return 0;
485: }
486:
487: public QueryResultContainer getAllQueryResults(CompiledQuery cq,
488: Object[] params) {
489: return em.getStorageManager().executeQueryAll(em, null, cq,
490: params);
491: }
492:
493: public void setMasterOnDetail(PersistenceCapable detail,
494: int managedFieldNo, PersistenceCapable master,
495: boolean removeFromCurrentMaster) {
496: }
497:
498: public Object getObjectField(PersistenceCapable pc, int fieldNo) {
499: return null;
500: }
501: }
|