01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.persistency.key.impl;
10:
11: import com.completex.objective.components.log.Log;
12: import com.completex.objective.components.persistency.OdalPersistencyException;
13: import com.completex.objective.components.persistency.Persistency;
14: import com.completex.objective.components.persistency.Record;
15: import com.completex.objective.components.persistency.core.DatabasePolicy;
16: import com.completex.objective.components.persistency.transact.Transaction;
17:
18: /**
19: * Implementation of AbstractOdalSequenceKeyGenerator.
20: * @see AbstractOdalSequenceKeyGenerator
21: *
22: * @author Gennady Krizhevsky
23: */
24: public class OdalSimpleSequenceKeyGenerator extends
25: AbstractOdalSequenceKeyGenerator {
26:
27: public OdalSimpleSequenceKeyGenerator() {
28: }
29:
30: public OdalSimpleSequenceKeyGenerator(String tableName,
31: boolean sameTransaction, DatabasePolicy databasePolicy,
32: String seqName, Log logger) {
33: super (tableName, sameTransaction);
34: setDatabasePolicy(databasePolicy);
35: setSeqName(seqName);
36: setLogger(logger);
37: }
38:
39: /**
40: * @see AbstractKeyGenerator#getNextKey(Transaction transaction, Persistency persistency, Record record)
41: */
42: public Object getNextKey(Transaction transaction,
43: Persistency persistency, Record record)
44: throws OdalPersistencyException {
45: return getNextKey(transaction, persistency, null, getSeqName());
46: }
47:
48: /**
49: * @see AbstractKeyGenerator#getNextKey(Transaction transaction, Persistency persistency, Record record, Object object)
50: */
51: public Object getNextKey(Transaction transaction,
52: Persistency persistency, Record record, Object object)
53: throws OdalPersistencyException {
54: return getNextKeyPlain(transaction, persistency,
55: (String) object);
56: }
57: }
|