org.javaWebGen.data
Class GenericSequence

java.lang.Object
  extended by org.javaWebGen.data.DAO
      extended by 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)
);


Field Summary
static java.lang.String GEN_KEY
           
static java.lang.String GEN_VALUE
           
static java.lang.String sql
           
static java.lang.String UPDATE_SQL
           
 
Fields inherited from class org.javaWebGen.data.DAO
TOO_MANY_ROWS, TOO_MANY_ROWS_WARNING
 
Constructor Summary
protected GenericSequence(DataManager dmanager)
           
 
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
 

Field Detail

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
Constructor Detail

GenericSequence

protected GenericSequence(DataManager dmanager)
Method Detail

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 connection
tableName - 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.