Module spring.data.relational
Interface IdGeneration
public interface IdGeneration
Encapsulates various properties that are related to ID generation process and specific to given
Dialect- Since:
- 2.1
- Author:
- Jens Schauder, Chirag Tailor, Mikhail Polivakha
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IdGenerationA default instance working for many databases and equivalent to Spring Data JDBCs behavior before version 2.1. -
Method Summary
Modifier and TypeMethodDescriptionstatic IdGenerationcreate(IdentifierProcessing identifierProcessing) static StringcreateSequenceQuery(String nameString) default StringcreateSequenceQuery(SqlIdentifier sequenceName) The SQL statement that allows retrieving the next value from the passed sequencedefault booleanDoes the driver require the specification of those columns for which a generated id shall be returned.default StringProvides for a given idSqlIdentifierthe String that is to be used for registering interest in the generated value of that column.default booleandefault booleanDoes 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
-
create
-
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 idSqlIdentifierthe String that is to be used for registering interest in the generated value of that column.- Parameters:
id-SqlIdentifierrepresenting 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:
-
sequencesSupported
default boolean sequencesSupported()- Returns:
- true in case the sequences are supported by the underlying database, false otherwise
- Since:
- 3.5
-
createSequenceQuery
The SQL statement that allows retrieving the next value from the passed sequence- Parameters:
sequenceName- the sequence name to get the next value for- Returns:
- SQL string
- Since:
- 3.5
-
createSequenceQuery
-