public final class MaxKeyGenerator extends AbstractBeforeKeyGenerator
MaxKeyGeneratorFactory| Constructor and Description |
|---|
MaxKeyGenerator(PersistenceFactory factory,
int sqlType)
Initialize the MAX key generator.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
generateKey(Connection conn,
String tableName,
String primKeyName)
Generate a new key for the specified table as "MAX(primary_key) + 1".
|
boolean |
isInSameConnection()
Is key generated in the same connection as INSERT?
For DURING_INSERT style this method is never called.
|
bindIdentity, buildStatement, executeStatementcloseSeparateConnection, getSeparateConnectionpublic MaxKeyGenerator(PersistenceFactory factory, int sqlType) throws MappingException
factory - A PersistenceFactory instance.sqlType - A SQLTypidentifier.MappingException - if this key generator is not compatible with the
persistance factory.public Object generateKey(Connection conn, String tableName, 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()
Copyright © 2014. All rights reserved.