KeyGenerator
public class TableKeyGenerator extends AbstractBeforeKeyGenerator
Modifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_ALLOCATION_SIZE |
|
static int |
DEFAULT_INITIAL_VALUE |
|
static java.lang.String |
DEFAULT_PK_COLUMN_NAME |
|
static java.lang.String |
DEFAULT_PK_COLUMN_VALUE |
|
static java.lang.String |
DEFAULT_TABLE_NAME |
|
static java.lang.String |
DEFAULT_VALUE_COLUMN_NAME |
|
static java.lang.String |
DESCRIPTOR_KEY |
Constructor | Description |
---|---|
TableKeyGenerator(PersistenceFactory factory,
java.util.Properties params,
int sqlType) |
Creates an instance of this key generator.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
generateKey(java.sql.Connection connection,
java.lang.String tableName,
java.lang.String primKeyName) |
Generate a new key for the specified table.
|
JPATableGeneratorDescriptor |
getDescriptor() |
|
PersistenceFactory |
getFactory() |
|
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 static final java.lang.String DESCRIPTOR_KEY
public static final java.lang.String DEFAULT_TABLE_NAME
public static final int DEFAULT_ALLOCATION_SIZE
public static final int DEFAULT_INITIAL_VALUE
public static final java.lang.String DEFAULT_PK_COLUMN_NAME
public static final java.lang.String DEFAULT_VALUE_COLUMN_NAME
public static final java.lang.String DEFAULT_PK_COLUMN_VALUE
public TableKeyGenerator(PersistenceFactory factory, java.util.Properties params, int sqlType) throws MappingException
factory
- The current PersistenceFactory
instance.params
- Parameters for the key generator.sqlType
- The SQL type of the identity field.MappingException
public java.lang.Object generateKey(java.sql.Connection connection, java.lang.String tableName, java.lang.String primKeyName) throws PersistenceException
KeyGenerator
connection
- An open connection within the given transactiontableName
- The table nameprimKeyName
- The primary key namePersistenceException
- An error occured talking to persistent
storagepublic boolean isInSameConnection()
KeyGenerator
public PersistenceFactory getFactory()
public JPATableGeneratorDescriptor getDescriptor()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com