public abstract class AbstractPreGenerateIdGenerator extends AbstractIdGenerator
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractPreGenerateIdGenerator.IdContext
A context for identity values.
|
| Modifier and Type | Field and Description |
|---|---|
protected long |
allocationSize |
protected java.util.concurrent.ConcurrentMap<java.lang.String,AbstractPreGenerateIdGenerator.IdContext> |
idContextMap |
protected long |
initialValue |
| Constructor and Description |
|---|
AbstractPreGenerateIdGenerator() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Long |
generatePostInsert(IdGenerationConfig config,
java.sql.Statement statement)
Generates the identity value after an insert.
|
java.lang.Long |
generatePreInsert(IdGenerationConfig config)
Generates the identity value before an insert.
|
protected AbstractPreGenerateIdGenerator.IdContext |
getIdContext(IdGenerationConfig config)
Returns the identity context.
|
protected abstract long |
getNewInitialValue(IdGenerationConfig config)
Return the next initial value.
|
boolean |
includesIdentityColumn(IdGenerationConfig config)
Whether this generator includes the identity column into SQL INSERT statements.
|
void |
setAllocationSize(long allocationSize)
Sets the allocation size.
|
void |
setInitialValue(long initialValue)
Sets the initial value.
|
boolean |
supportsAutoGeneratedKeys(IdGenerationConfig config)
Whether this generator supports
Statement.getGeneratedKeys(). |
boolean |
supportsBatch(IdGenerationConfig config)
Whether this generator supports the batch insert.
|
getGeneratedValue, getGeneratedValue, setupOptionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGenerationTypeprotected long initialValue
protected long allocationSize
protected final java.util.concurrent.ConcurrentMap<java.lang.String,AbstractPreGenerateIdGenerator.IdContext> idContextMap
public void setInitialValue(long initialValue)
initialValue - the initial valuepublic void setAllocationSize(long allocationSize)
allocationSize - the allocation sizepublic boolean supportsBatch(IdGenerationConfig config)
IdGeneratorconfig - the configurationtrue if this generator supportspublic boolean supportsAutoGeneratedKeys(IdGenerationConfig config)
IdGeneratorStatement.getGeneratedKeys().config - the configurationtrue if this generator supportspublic boolean includesIdentityColumn(IdGenerationConfig config)
IdGeneratorconfig - the configurationtrue if supportedpublic java.lang.Long generatePreInsert(IdGenerationConfig config)
IdGeneratorconfig - the configurationnull if not supportedpublic java.lang.Long generatePostInsert(IdGenerationConfig config, java.sql.Statement statement)
IdGeneratorconfig - the configurationstatement - the SQL INSERT statementnull if not supportedprotected AbstractPreGenerateIdGenerator.IdContext getIdContext(IdGenerationConfig config)
config - the configurationprotected abstract long getNewInitialValue(IdGenerationConfig config)
config - the configurationJdbcException - if it fails to retrieve the next initial value.