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 Details

    • DEFAULT

      static final IdGeneration DEFAULT
      A default instance working for many databases and equivalent to Spring Data JDBCs behavior before version 2.1.
  • Method Details

    • create

      static IdGeneration create(IdentifierProcessing identifierProcessing)
    • 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

      default String getKeyColumnName(SqlIdentifier id)
      Provides for a given id SqlIdentifier 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:
    • sequencesSupported

      default boolean sequencesSupported()
      Returns:
      true in case the sequences are supported by the underlying database, false otherwise
      Since:
      3.5
    • createSequenceQuery

      default String createSequenceQuery(SqlIdentifier sequenceName)
      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

      static String createSequenceQuery(String nameString)