public final class SequenceBeforeKeyGenerator extends AbstractBeforeKeyGenerator
| Constructor and Description |
|---|
SequenceBeforeKeyGenerator(PersistenceFactory factory,
Properties params,
int sqlType)
Initialize the SEQUENCE key generator for BEFORE_INSERT style
generateKey(java.sql.Connection, java.lang.String, java.lang.String) is called before INSERT. |
| Modifier and Type | Method and Description |
|---|---|
Object |
generateKey(Connection conn,
String tableName,
String primKeyName)
Generate a new key for the specified table.
|
protected void |
initSqlTypeHandler(int sqlType)
Initialize the Handler based on SQL Type.
|
boolean |
isInSameConnection()
Is key generated in the same connection as INSERT?
For DURING_INSERT style this method is never called.
|
bindIdentity, buildStatement, executeStatementcloseSeparateConnection, getSeparateConnectionpublic SequenceBeforeKeyGenerator(PersistenceFactory factory, Properties params, int sqlType) throws MappingException
generateKey(java.sql.Connection, java.lang.String, java.lang.String) is called before INSERT.factory - A PersistenceFactory instance.params - Database specific properties.sqlType - A SQLTypidentifier.MappingException - if this key generator is not compatible with the
persistance factory.protected void initSqlTypeHandler(int sqlType)
sqlType - A SQLTypidentifier.public Object generateKey(Connection conn, String tableName, String primKeyName) throws PersistenceException
KeyGeneratorconn - An open connection within the given transaction.tableName - The table name.primKeyName - The primary key name.PersistenceException - An error occured talking to persistent storage.public boolean isInSameConnection()
Copyright © 2014. All rights reserved.