public class BuiltinIdentityIdGenerator extends AbstractIdGenerator implements IdentityIdGenerator
IdentityIdGenerator.| Constructor and Description |
|---|
BuiltinIdentityIdGenerator() |
| 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 long |
getGeneratedValue(IdGenerationConfig config)
Retrieves the generated value by using a specific SQL.
|
protected long |
getGeneratedValue(IdGenerationConfig config,
java.sql.Statement statement)
Retrieves the generated value by using
Statement.getGeneratedKeys(). |
GenerationType |
getGenerationType()
Returns the generation type.
|
boolean |
includesIdentityColumn(IdGenerationConfig config)
Whether this generator includes the identity column into SQL INSERT statements.
|
boolean |
supportsAutoGeneratedKeys(IdGenerationConfig config)
Whether this generator supports
Statement.getGeneratedKeys(). |
boolean |
supportsBatch(IdGenerationConfig config)
Whether this generator supports the batch insert.
|
getGeneratedValue, getGeneratedValue, setupOptionspublic boolean supportsBatch(IdGenerationConfig config)
IdGeneratorsupportsBatch in interface IdGeneratorconfig - the configurationtrue if this generator supportspublic boolean includesIdentityColumn(IdGenerationConfig config)
IdGeneratorincludesIdentityColumn in interface IdGeneratorconfig - the configurationtrue if supportedpublic boolean supportsAutoGeneratedKeys(IdGenerationConfig config)
IdGeneratorStatement.getGeneratedKeys().supportsAutoGeneratedKeys in interface IdGeneratorconfig - the configurationtrue if this generator supportspublic java.lang.Long generatePreInsert(IdGenerationConfig config)
IdGeneratorgeneratePreInsert in interface IdGeneratorconfig - the configurationnull if not supportedpublic java.lang.Long generatePostInsert(IdGenerationConfig config, java.sql.Statement statement)
IdGeneratorgeneratePostInsert in interface IdGeneratorconfig - the configurationstatement - the SQL INSERT statementnull if not supportedprotected long getGeneratedValue(IdGenerationConfig config, java.sql.Statement statement)
Statement.getGeneratedKeys().config - the configurationstatement - the SQL INSERT statementJdbcException - if the generation is failedprotected long getGeneratedValue(IdGenerationConfig config)
config - the configurationJdbcException - if the generation is failedpublic GenerationType getGenerationType()
IdGeneratorgetGenerationType in interface IdGenerator