java.lang.Object
org.seasar.doma.jdbc.id.AbstractIdGenerator
- All Implemented Interfaces:
IdGenerator
- Direct Known Subclasses:
AbstractPreGenerateIdGenerator,BuiltinIdentityIdGenerator
A skeletal implementation of the
IdGenerator interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longgetGeneratedValue(IdGenerationConfig config, ResultSet resultSet) Retrieves a generated identity from theResultSetobject.protected longgetGeneratedValue(IdGenerationConfig config, Sql<?> sql) Executes the SQL and gets a generated identity.protected voidsetupOptions(IdGenerationConfig config, PreparedStatement preparedStatement) Set up options for thepreparedStatementobject.Methods 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
generatePostInsert, generatePreInsert, generateValuesPostInsert, generateValuesPreInsert, getGenerationType, includesIdentityColumn, includesIdentityColumn, supportsAutoGeneratedKeys, supportsBatch
-
Constructor Details
-
AbstractIdGenerator
public AbstractIdGenerator()
-
-
Method Details
-
getGeneratedValue
Executes the SQL and gets a generated identity.- Parameters:
config- the configuration for identity generationsql- the SQL to get the generated identityL- Returns:
- the generated identity
- Throws:
JdbcException- if a JDBC related error occurs
-
setupOptions
protected void setupOptions(IdGenerationConfig config, PreparedStatement preparedStatement) throws SQLException Set up options for thepreparedStatementobject.- Parameters:
config- the configuration for identity generationpreparedStatement- the prepared statement- Throws:
SQLException- if operations for thepreparedStatementare failed
-
getGeneratedValue
Retrieves a generated identity from theResultSetobject.- Parameters:
config- the configuration for identity generationresultSet- the result set- Returns:
- the generated identity
- Throws:
JdbcException- if a JDBC related error occurs
-