KeyGenerator
public final class HighLowKeyGenerator extends AbstractBeforeKeyGenerator
HighLowKeyGeneratorFactory
Constructor | Description |
---|---|
HighLowKeyGenerator(PersistenceFactory factory,
java.util.Properties params,
int sqlType) |
Initialize the HIGH-LOW key generator.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
generateKey(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String primKeyName) |
Generate a new key for the specified table.
|
void |
initFromParameters(java.util.Properties params) |
Method to init some class variables.
|
boolean |
isInSameConnection() |
Is key generated in the same connection as INSERT?
For DURING_INSERT style this method is never called.
|
bindIdentity, buildStatement, executeStatement
closeSeparateConnection, getSeparateConnection
public HighLowKeyGenerator(PersistenceFactory factory, java.util.Properties params, int sqlType) throws MappingException
factory
- A PersistenceFactory instance.params
- Database engine specific parameters.sqlType
- A SQLTypidentifier.MappingException
- if this key generator is not compatible with the
persistance factory.public void initFromParameters(java.util.Properties params) throws MappingException
params
- Database engine specific parameters.MappingException
- if this key generator is not compatible with the
persistance factory.public java.lang.Object generateKey(java.sql.Connection conn, java.lang.String tableName, java.lang.String primKeyName) throws PersistenceException
conn
- An open connection within the given transactiontableName
- The table nameprimKeyName
- The primary key namePersistenceException
- An error occured talking to persistent
storagepublic boolean isInSameConnection()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com