SequenceIdentityManager
or other identity manager
which supports database-wide unique ids.
Implementation of the IdentityManager
interface. During server
initialization, each database table is queried to determine its maximum
primary key ID. This information is stored in a map for later use in
providing the next available ID for each table. The per-table value is
incremented for each ID request
.
Current limitations:
Long.MAX_VALUE
is not handled at this time.
public final class TableHighIdentityManager extends java.lang.Object implements IdentityPoolManager
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Long> |
ids
Deprecated.
Map for storing table name -> current maximum ID relations.
|
private static org.apache.commons.logging.Log |
LOG
Deprecated.
Logger
|
private Persistence |
persistence
Deprecated.
Persistence service object used to interact with the database
|
Constructor and Description |
---|
TableHighIdentityManager()
Deprecated.
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.io.Serializable |
nextPrimaryKey(java.lang.String table)
Deprecated.
Return the next primary key for the specified table.
|
void |
reclaimKeys(java.io.Serializable[] keys)
Deprecated.
Inform ithe dentity manager that the given primary keys can be reused.
|
void |
setIdentityPool(IdentityPool identityPool)
Deprecated.
Sets identity pool which can be used by this identity manager.
|
void |
setPersistence(Persistence persistence)
Deprecated.
Specify the database for the identity manager.
|
private static final org.apache.commons.logging.Log LOG
private final java.util.Map<java.lang.String,java.lang.Long> ids
private Persistence persistence
public TableHighIdentityManager()
public void setPersistence(Persistence persistence)
TableHighIdentityManager
is initialized here - current
maximum IDs for each table are retrieved.setPersistence
in interface IdentityManager
persistence
- Persistence service object associated with identity manager.public java.io.Serializable nextPrimaryKey(java.lang.String table) throws PersistenceException
nextPrimaryKey
in interface IdentityManager
table
- Table for which the next primary key will be returned.PersistenceException
- if there is an error determining the next primary key ID.public void reclaimKeys(java.io.Serializable[] keys)
reclaimKeys
in interface IdentityManager
keys
- Keys for reuse.public void setIdentityPool(IdentityPool identityPool)
setIdentityPool
in interface IdentityPoolManager
identityPool
- Identity pool for use.