Interface IdGeneration
public interface IdGeneration
Describes how obtaining generated ids after an insert works for a given JDBC driver.
- Since:
- 2.1
- Author:
- Jens Schauder, Chirag Tailor
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IdGeneration
A default instance working for many databases and equivalent to Spring Data JDBCs behavior before version 2.1. -
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Does the driver require the specification of those columns for which a generated id shall be returned.default String
Provides for a given idSqlIdentifier
the String that is to be used for registering interest in the generated value of that column.default boolean
Does the driver support id generation for batch operations.
-
Field Details
-
DEFAULT
A default instance working for many databases and equivalent to Spring Data JDBCs behavior before version 2.1.
-
-
Method Details
-
driverRequiresKeyColumnNames
default boolean driverRequiresKeyColumnNames()Does the driver require the specification of those columns for which a generated id shall be returned.This should be false for most dialects. One notable exception is Oracle.
- Returns:
- true if the a list of column names should get passed to the JDBC driver for which ids shall be generated.
- See Also:
-
getKeyColumnName
Provides for a given idSqlIdentifier
the String that is to be used for registering interest in the generated value of that column.- Parameters:
id
-SqlIdentifier
representing a column for which a generated value is to be obtained.- Returns:
- a String representing that column in the way expected by the JDBC driver.
- Since:
- 3.3
-
supportedForBatchOperations
default boolean supportedForBatchOperations()Does the driver support id generation for batch operations.This should be true for most dialects, except DB2 and SqlServer.
- Returns:
- true if the JDBC driver supports generated keys for batch operations.
- Since:
- 2.4
- See Also:
-