java.lang.Object
org.seasar.doma.jdbc.id.AbstractIdGenerator
org.seasar.doma.jdbc.id.BuiltinIdentityIdGenerator
- All Implemented Interfaces:
IdentityIdGenerator,IdGenerator
The built-in implementation for
IdentityIdGenerator.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongeneratePostInsert(IdGenerationConfig config, Statement statement) Generates the identity value after an insert.generatePreInsert(IdGenerationConfig config) Generates the identity value before an insert.generateValuesPostInsert(IdGenerationConfig config, Statement statement) protected longgetGeneratedValue(IdGenerationConfig config) Retrieves the generated value by using a specific SQL.protected longgetGeneratedValue(IdGenerationConfig config, Statement statement) Retrieves the generated value by usingStatement.getGeneratedKeys().Returns the generation type.booleanWhether this generator includes the identity column into SQL INSERT statements.booleanincludesIdentityColumn(IdGenerationConfig config, Object idValue) Determines whether the identity column is included in the SQL INSERT statements based on the given configuration and identity value.booleanWhether this generator supportsStatement.getGeneratedKeys().booleansupportsBatch(IdGenerationConfig config) Whether this generator supports the batch insert.Methods inherited from class org.seasar.doma.jdbc.id.AbstractIdGenerator
getGeneratedValue, getGeneratedValue, setupOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.seasar.doma.jdbc.id.IdGenerator
generateValuesPreInsert
-
Constructor Details
-
BuiltinIdentityIdGenerator
public BuiltinIdentityIdGenerator()
-
-
Method Details
-
supportsBatch
Description copied from interface:IdGeneratorWhether this generator supports the batch insert.- Specified by:
supportsBatchin interfaceIdGenerator- Parameters:
config- the configuration- Returns:
trueif this generator supports
-
includesIdentityColumn
Description copied from interface:IdGeneratorWhether this generator includes the identity column into SQL INSERT statements.- Specified by:
includesIdentityColumnin interfaceIdGenerator- Parameters:
config- the configuration- Returns:
trueif supported
-
includesIdentityColumn
Description copied from interface:IdGeneratorDetermines whether the identity column is included in the SQL INSERT statements based on the given configuration and identity value.The type of
idValuemust be one of the basic types. It must never be a domain class or an Optional type that wraps a basic type.- Specified by:
includesIdentityColumnin interfaceIdGenerator- Parameters:
config- the configuration for identity generationidValue- an identity value; may be null- Returns:
trueif the identity column is included in the SQL INSERT statements, otherwisefalse
-
supportsAutoGeneratedKeys
Description copied from interface:IdGeneratorWhether this generator supportsStatement.getGeneratedKeys().- Specified by:
supportsAutoGeneratedKeysin interfaceIdGenerator- Parameters:
config- the configuration- Returns:
trueif this generator supports
-
generatePreInsert
Description copied from interface:IdGeneratorGenerates the identity value before an insert.- Specified by:
generatePreInsertin interfaceIdGenerator- Parameters:
config- the configuration- Returns:
- the generated value or
nullif not supported
-
generatePostInsert
Description copied from interface:IdGeneratorGenerates the identity value after an insert.- Specified by:
generatePostInsertin interfaceIdGenerator- Parameters:
config- the configurationstatement- the SQL INSERT statement- Returns:
- the generated value or
nullif not supported
-
getGeneratedValue
Retrieves the generated value by usingStatement.getGeneratedKeys().- Parameters:
config- the configurationstatement- the SQL INSERT statement- Returns:
- the generated value
- Throws:
JdbcException- if the generation is failed
-
getGeneratedValue
Retrieves the generated value by using a specific SQL.- Parameters:
config- the configuration- Returns:
- the generated value
- Throws:
JdbcException- if the generation is failed
-
generateValuesPostInsert
- Specified by:
generateValuesPostInsertin interfaceIdGenerator
-
getGenerationType
Description copied from interface:IdGeneratorReturns the generation type.- Specified by:
getGenerationTypein interfaceIdGenerator- Returns:
- the generation type
-