org.javaWebGen.data
Class GenericSequence
java.lang.Object
org.javaWebGen.data.DAO
org.javaWebGen.data.GenericSequence
- All Implemented Interfaces:
- Sequence
public final class GenericSequence
- extends DAO
- implements Sequence
used to find next unique value(sequence) of a primary key
for a database using a special table called org_kev_index
The table will use the following DDL
CREATE TABLE id_gen (
gen_key VARCHAR(20) NOT NULL,
gen_value INTEGER NOT NULL,
primary key (gen_key)
);
Method Summary |
int |
getNextValue(java.sql.Connection con,
java.lang.String tableName)
Calls the DataManager object for the next value for a primary key |
int |
getNextValue(java.lang.String tableName)
Calls the DataManager object for the next value for a primary key |
Methods inherited from class org.javaWebGen.data.DAO |
close, getColumnClass, getConnection, getDataManager, getResultSet, query, query, query, query, runQuery, runQuery, runQuery, runQuery, setColumn, update, update, update, update, updateDataBean, updateDataBean |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GEN_KEY
public static final java.lang.String GEN_KEY
- See Also:
- Constant Field Values
GEN_VALUE
public static final java.lang.String GEN_VALUE
- See Also:
- Constant Field Values
sql
public static final java.lang.String sql
- See Also:
- Constant Field Values
UPDATE_SQL
public static final java.lang.String UPDATE_SQL
- See Also:
- Constant Field Values
GenericSequence
protected GenericSequence(DataManager dmanager)
getNextValue
public int getNextValue(java.lang.String tableName)
throws DBException
- Description copied from class:
DAO
- Calls the DataManager object for the next value for a primary key
- Specified by:
getNextValue
in interface Sequence
- Overrides:
getNextValue
in class DAO
- Parameters:
tableName
- table name
- Returns:
- the next value for a primary key
- Throws:
DBException
- See Also:
DataManager
getNextValue
public int getNextValue(java.sql.Connection con,
java.lang.String tableName)
throws java.sql.SQLException
- Description copied from class:
DAO
- Calls the DataManager object for the next value for a primary key
- Specified by:
getNextValue
in interface Sequence
- Overrides:
getNextValue
in class DAO
- Parameters:
con
- DB connectiontableName
- table name
- Returns:
- the next value for a primary key
- Throws:
java.sql.SQLException
- See Also:
DataManager
Copyright(C) 2003-2006 Kevin Scott - All Rights Reserved.