com.programix.sql
Class UniqueIDGenerator
java.lang.Object
com.programix.sql.UniqueIDGenerator
public class UniqueIDGenerator
- extends Object
Sets up a simple, thread-safe, unique id generator that uses a database
table to control concurrency.
The ValueMap passed can be created from a file that looks
something like this:
sql.id.generator.table.name=id_list
sql.id.generator.match.column.name=name
sql.id.generator.id.column.name=last_id
- Author:
- Paul Hyde
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TABLE_NAME_KEY
public static final String TABLE_NAME_KEY
- See Also:
- Constant Field Values
MATCH_COLUMN_KEY
public static final String MATCH_COLUMN_KEY
- See Also:
- Constant Field Values
ID_COLUMN_KEY
public static final String ID_COLUMN_KEY
- See Also:
- Constant Field Values
UniqueIDGenerator
public UniqueIDGenerator(ConnectionSource connectionSource,
String tableName,
String matchColumnName,
String idColumnName)
UniqueIDGenerator
public UniqueIDGenerator(ConnectionSource connectionSource,
ValueMap config)
throws ValueMapException
- Throws:
ValueMapException
generateUniqueID
public int generateUniqueID(String tableName)
throws SQLException
- Throws:
SQLException
generateUniqueID
public int generateUniqueID(String tableName,
Connection con)
throws SQLException
- Throws:
SQLException
Copyright © 2001-2009
Programix Incorporated.
All rights reserved.
ProgramixGenericLib is free
and is
OSI Certified
Open Source Software under the BSD
license.