001: /**
002: * Objective Database Abstraction Layer (ODAL)
003: * Copyright (c) 2004, The ODAL Development Group
004: * All rights reserved.
005: * For definition of the ODAL Development Group please refer to LICENCE.txt file
006: *
007: * Distributable under LGPL license.
008: * See terms of license at gnu.org.
009: */package com.completex.objective.components.persistency;
010:
011: import com.completex.objective.components.persistency.core.DatabasePolicy;
012: import com.completex.objective.components.persistency.core.impl.LinkIterator;
013: import com.completex.objective.components.persistency.core.impl.query.QueryContextImpl;
014: import com.completex.objective.components.persistency.core.impl.query.QueryContext;
015: import com.completex.objective.components.persistency.transact.Transaction;
016: import com.completex.objective.components.persistency.transact.TransactionManager;
017: import com.completex.objective.components.persistency.transact.TransactionManagerAware;
018: import com.completex.objective.components.persistency.type.MultipartCollection;
019: import com.completex.objective.components.persistency.type.TracingCollection;
020: import com.completex.objective.components.persistency.type.TypeHandler;
021:
022: import java.sql.SQLException;
023: import java.util.Collection;
024: import java.util.List;
025:
026: /**
027: * @author Gennady Krizhevsky
028: */
029: public interface Persistency extends LightPersistency,
030: TransactionManagerAware {
031:
032: static final NullPersistencyImpl NULL_PERSISTENCY = new NullPersistencyImpl();
033:
034: /**
035: * Executes stored procedure call that doe not return result set
036: *
037: * @param call Call object
038: * @throws java.sql.SQLException
039: */
040: void executeCall(Call call) throws SQLException;
041:
042: //
043: // Null implementation:
044: //
045: static class NullPersistencyImpl implements Persistency,
046: PersistencyChildManager {
047: public Object reset(Object[] params) {
048: return null;
049: }
050:
051: public void registerTypeHandler(ColumnType columnType,
052: TypeHandler typeHandler) {
053: }
054:
055: public int deleteByExample(PersistentObject persistentObject,
056: LifeCycleController controller, int limit)
057: throws OdalPersistencyException {
058: return 0;
059: }
060:
061: public PersistentObject loadForUpdate(
062: PersistentObject persistentObject, boolean wait)
063: throws OdalPersistencyException {
064: return null;
065: }
066:
067: public Object loadForUpdate(PersistentObject persistentObject)
068: throws OdalPersistencyException {
069: return null;
070: }
071:
072: public Collection select(PersistentObject persistentObject,
073: LifeCycleController controller, LockType lock,
074: long timeout) throws OdalPersistencyException {
075: return null;
076: }
077:
078: public Object load(PersistentObject persistentObject,
079: LockType lockType, long timeout)
080: throws OdalPersistencyException {
081: return null;
082: }
083:
084: public Object load(PersistentObject persistentObject,
085: LifeCycleController controller)
086: throws OdalPersistencyException {
087: return null;
088: }
089:
090: public Object load(PersistentObject persistentObject,
091: LifeCycleController controller, LockType lockType,
092: long timeout) throws OdalPersistencyException {
093: return null;
094: }
095:
096: public Collection select(Transaction transaction,
097: PersistentObject persistentObject,
098: LifeCycleController controller)
099: throws OdalPersistencyException {
100: return null;
101: }
102:
103: public int insert(Transaction transaction, LinkIterator it,
104: LifeCycleController controller)
105: throws OdalPersistencyException {
106: return 0;
107: }
108:
109: public long selectCount(PersistentObject persistentObject)
110: throws OdalPersistencyException {
111: return 0;
112: }
113:
114: public Collection selectForUpdate(
115: PersistentObject persistentObject, boolean wait)
116: throws OdalPersistencyException {
117: return null;
118: }
119:
120: public Collection selectForUpdate(
121: PersistentObject persistentObject)
122: throws OdalPersistencyException {
123: return null;
124: }
125:
126: public Object selectFirst(PersistentObject persistentObject,
127: LifeCycleController controller)
128: throws OdalPersistencyException {
129: return null;
130: }
131:
132: public Object selectFirstForUpdate(
133: PersistentObject persistentObject)
134: throws OdalPersistencyException {
135: return null;
136: }
137:
138: public boolean isUseBatchModify() {
139: return false;
140: }
141:
142: public int deleteByExample(PersistentObject persistentObject)
143: throws OdalPersistencyException {
144: return 0;
145: }
146:
147: public int deleteByExample(PersistentObject persistentObject,
148: int limit) throws OdalPersistencyException {
149: return 0;
150: }
151:
152: public int deleteByExample(PersistentObject persistentObject,
153: LifeCycleController controller)
154: throws OdalPersistencyException {
155: return 0;
156: }
157:
158: public int delete(Transaction transaction,
159: PersistentObject persistentObject,
160: LifeCycleController controller)
161: throws OdalPersistencyException {
162: return 0;
163: }
164:
165: public Collection select(Query query,
166: LifeCycleController controller)
167: throws OdalPersistencyException {
168: return null;
169: }
170:
171: public void selectChild(Transaction transaction,
172: PersistentObject parent, String name, Link link)
173: throws OdalPersistencyException {
174: }
175:
176: public List selectTree(Transaction transaction, Query query)
177: throws OdalPersistencyException {
178: return null;
179: }
180:
181: public PersistentObject load(Transaction transaction,
182: PersistentObject persistentObject)
183: throws OdalPersistencyException {
184: return null;
185: }
186:
187: public List select(Transaction transaction,
188: PersistentObject persistentObject)
189: throws OdalPersistencyException {
190: return null;
191: }
192:
193: public List select(Transaction transaction, Query query)
194: throws OdalPersistencyException {
195: return null;
196: }
197:
198: public Collection select(PersistentObject persistentObject,
199: LifeCycleController controller)
200: throws OdalPersistencyException {
201: return null;
202: }
203:
204: public int insert(Transaction transaction,
205: PersistentObject persistentObject)
206: throws OdalPersistencyException {
207: return 0;
208: }
209:
210: public int insert(Transaction transaction,
211: PersistentObject persistentObject,
212: LifeCycleController controller)
213: throws OdalPersistencyException {
214: return 0;
215: }
216:
217: public boolean selectExists(Transaction transaction, Query query)
218: throws OdalPersistencyException {
219: return false;
220: }
221:
222: public long selectCount(Transaction transaction, Query query)
223: throws OdalPersistencyException {
224: return 0;
225: }
226:
227: public PersistentObject selectFirst(Transaction transaction,
228: Query query) throws OdalPersistencyException {
229: return null;
230: }
231:
232: public Object selectSingle(Transaction transaction, Query query)
233: throws OdalPersistencyException {
234: return null;
235: }
236:
237: public int update(Transaction transaction,
238: PersistentObject persistentObject)
239: throws OdalPersistencyException {
240: return 0;
241: }
242:
243: public Collection select(PersistentObject persistentObject,
244: LifeCycleController controller, LockType lock)
245: throws OdalPersistencyException {
246: return null;
247: }
248:
249: public int update(PersistentObject persistentObject,
250: String extraWhere, Object[] extraParameters,
251: LifeCycleController controller)
252: throws OdalPersistencyException {
253: return 0;
254: }
255:
256: public int[] update(Collection collection,
257: LifeCycleController lifeCycleController)
258: throws OdalPersistencyException {
259: return new int[0];
260: }
261:
262: public DatabasePolicy getDatabasePolicy() {
263: return DatabasePolicy.NULL_DATABASE_POLICY;
264: }
265:
266: public TransactionManager getTransactionManager() {
267: return TransactionManager.NULL_TRANSACTION_MANAGER;
268: }
269:
270: public QueryFactory getQueryFactory() {
271: return null;
272: }
273:
274: public CallFactory getCallFactory() {
275: return null;
276: }
277:
278: public SelectQueryBuilder getSelectQueryBuilder() {
279: return null;
280: }
281:
282: public Object load(PersistentObject persistentObject)
283: throws OdalPersistencyException {
284: return null;
285: }
286:
287: public Collection select(PersistentObject persistentObject)
288: throws OdalPersistencyException {
289: return null;
290: }
291:
292: public Collection select(Query query)
293: throws OdalPersistencyException {
294: return null;
295: }
296:
297: public boolean selectExists(Query query)
298: throws OdalPersistencyException {
299: return false;
300: }
301:
302: public long selectCount(Query query)
303: throws OdalPersistencyException {
304: return 0;
305: }
306:
307: public Object selectFirst(Query query)
308: throws OdalPersistencyException {
309: return null;
310: }
311:
312: public Object selectFirst(PersistentObject persistentObject)
313: throws OdalPersistencyException {
314: return null;
315: }
316:
317: public Object selectFirst(final Query query,
318: final LifeCycleController controller)
319: throws OdalPersistencyException {
320: return null;
321: }
322:
323: public boolean selectExists(PersistentObject persistentObject)
324: throws OdalPersistencyException {
325: return false;
326: }
327:
328: public Object selectSingle(Query query)
329: throws OdalPersistencyException {
330: return null;
331: }
332:
333: public int insert(PersistentObject persistentObject)
334: throws OdalPersistencyException {
335: return 0;
336: }
337:
338: public int insert(PersistentObject persistentObject,
339: LifeCycleController controller)
340: throws OdalPersistencyException {
341: return 0;
342: }
343:
344: public int update(PersistentObject persistentObject)
345: throws OdalPersistencyException {
346: return 0;
347: }
348:
349: public int update(PersistentObject persistentObject,
350: LifeCycleController controller)
351: throws OdalPersistencyException {
352: return 0;
353: }
354:
355: public int executeUpdate(String sql, Parameters parameters)
356: throws OdalPersistencyException {
357: return 0;
358: }
359:
360: public int executeUpdate(String sql)
361: throws OdalPersistencyException {
362: return 0;
363: }
364:
365: public int truncate(String tableName)
366: throws OdalPersistencyException {
367: return 0;
368: }
369:
370: public int delete(PersistentObject persistentObject)
371: throws OdalPersistencyException {
372: return 0;
373: }
374:
375: public int delete(PersistentObject persistentObject,
376: LifeCycleController controller)
377: throws OdalPersistencyException {
378: return 0;
379: }
380:
381: public int[] insert(Collection persistentObjects)
382: throws OdalPersistencyException {
383: return new int[0];
384: }
385:
386: public int[] delete(Collection persistentObjects)
387: throws OdalPersistencyException {
388: return new int[0];
389: }
390:
391: public int[] update(Collection persistentObjects)
392: throws OdalPersistencyException {
393: return new int[0];
394: }
395:
396: public long getNextSeqValue(String name)
397: throws OdalPersistencyException {
398: return 0;
399: }
400:
401: public Object load(PersistentObject persistentObject,
402: LockType lockType) throws OdalPersistencyException {
403: return null;
404: }
405:
406: public int update(PersistentObject persistentObject,
407: String extraWhere, Parameters extraParameters,
408: LifeCycleController controller)
409: throws OdalPersistencyException {
410: return 0;
411: }
412:
413: public int executeUpdate(String sql, Object[] values)
414: throws OdalPersistencyException {
415: return 0;
416: }
417:
418: public int[] update(TracingCollection collection,
419: Collection source,
420: LifeCycleController lifeCycleController)
421: throws OdalPersistencyException {
422: return new int[0];
423: }
424:
425: public int[] update(TracingCollection collection,
426: Collection source) throws OdalPersistencyException {
427: return new int[0];
428: }
429:
430: public Collection selectSinglePartResultCall(Call query,
431: LifeCycleController controller)
432: throws OdalPersistencyException {
433: return null;
434: }
435:
436: public Collection selectSinglePartResultCall(Call query)
437: throws OdalPersistencyException {
438: return null;
439: }
440:
441: public MultipartCollection selectMultiPartResultCall(
442: Call query, LifeCycleController controller)
443: throws OdalPersistencyException {
444: return null;
445: }
446:
447: public MultipartCollection selectMultiPartResultCall(Call query)
448: throws OdalPersistencyException {
449: return null;
450: }
451:
452: public int pipeInsert(PersistentObject persistentObject,
453: LifeCycleController controller)
454: throws OdalPersistencyException {
455: return 0;
456: }
457:
458: public int pipeInsert(PersistentObject persistentObject)
459: throws OdalPersistencyException {
460: return 0;
461: }
462:
463: public int update(PersistentObject persistentObject,
464: String extraWhere, Parameters extraParameters)
465: throws OdalPersistencyException {
466: return 0;
467: }
468:
469: public void executeCall(Call call) throws SQLException {
470: }
471:
472: public void selectChild(Transaction transaction,
473: AbstractPersistentObject parent, String name,
474: Link link, QueryContext queryContext)
475: throws OdalPersistencyException {
476: }
477:
478: public void selectChildren(Transaction transaction, Link link,
479: QueryContext queryContext)
480: throws OdalPersistencyException {
481: }
482:
483: public QueryContext getCurrentQueryContext() {
484: return null;
485: }
486:
487: public void setCurrentQueryContext(QueryContextImpl queryContext) {
488: }
489:
490: public void clearCurrentQueryContext() {
491: }
492: }
493: }
|