Class MssqlDialect

All Implemented Interfaces:
Dialect

public class MssqlDialect extends Mssql2008Dialect
A dialect for Microsoft SQL Server.
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: Dialect
      Returns the name of this dialect.

      The dialect name typically identifies the database system that this dialect supports. This name can be used for logging, debugging, or to make decisions based on the specific database being used.

      Each dialect implementation should return a unique and descriptive name.

      Specified by:
      getName in interface Dialect
      Overrides:
      getName in class Mssql2008Dialect
      Returns:
      the name of this dialect
    • toForUpdateSqlNode

      protected SqlNode toForUpdateSqlNode(SqlNode sqlNode, SelectForUpdateType forUpdateType, int waitSeconds, String... aliases)
      Overrides:
      toForUpdateSqlNode in class Mssql2008Dialect
    • toPagingSqlNode

      protected SqlNode toPagingSqlNode(SqlNode sqlNode, long offset, long limit)
      Overrides:
      toPagingSqlNode in class Mssql2008Dialect
    • getSequenceNextValSql

      public PreparedSql getSequenceNextValSql(String qualifiedSequenceName, long allocationSize)
      Description copied from interface: Dialect
      Returns an SQL object to retrieve the next value from a database sequence.

      This method creates the SQL statement needed to get the next value from a sequence.

      The allocation size parameter can be used to optimize sequence access by retrieving multiple values at once in database systems that support this feature.

      This method is available only if Dialect.supportsSequence() returns true.

      Specified by:
      getSequenceNextValSql in interface Dialect
      Overrides:
      getSequenceNextValSql in class StandardDialect
      Parameters:
      qualifiedSequenceName - the fully qualified name of the sequence, which may include catalog and schema information depending on the database system
      allocationSize - the number of sequence values to allocate at once for optimization; a value greater than 1 may improve performance by reducing database calls
      Returns:
      the SQL object that can be executed to retrieve the next sequence value(s)
    • supportsSequence

      public boolean supportsSequence()
      Description copied from interface: Dialect
      Determines whether this dialect supports database sequences.

      A sequence is a database object that generates a sequence of unique numbers. Sequences are commonly used to generate primary key values.

      Specified by:
      supportsSequence in interface Dialect
      Overrides:
      supportsSequence in class StandardDialect
      Returns:
      true if this dialect supports sequences, false otherwise
    • supportsAutoIncrementWhenInsertingMultipleRows

      public boolean supportsAutoIncrementWhenInsertingMultipleRows()
      Description copied from interface: Dialect
      Determines whether this dialect supports auto-increment columns when inserting multiple rows.

      Some databases do not properly handle auto-increment columns in multi-row insert statements, or have limitations on how generated values can be retrieved.

      The default implementation returns true.

      Returns:
      true if this dialect supports auto-increment columns in multi-row inserts, false otherwise
    • supportsUpsertEmulationWithMergeStatement

      public boolean supportsUpsertEmulationWithMergeStatement()
      Description copied from interface: Dialect
      Determines whether this dialect supports upsert emulation using MERGE statements.

      An upsert operation (update or insert) can be emulated using MERGE statements in some database systems. This method indicates whether the dialect supports this approach.

      The default implementation returns false.

      Returns:
      true if this dialect supports upsert emulation with MERGE statements, false otherwise
    • createScriptBlockContext

      public ScriptBlockContext createScriptBlockContext()
      Description copied from interface: Dialect
      Creates the context object to process an SQL block in a script.
      Specified by:
      createScriptBlockContext in interface Dialect
      Overrides:
      createScriptBlockContext in class Mssql2008Dialect
      Returns:
      the context object
    • getUpsertAssembler

      public UpsertAssembler getUpsertAssembler(UpsertAssemblerContext context)
      Description copied from interface: Dialect
      Returns the UpsertAssembler implementation for the given context.
      Specified by:
      getUpsertAssembler in interface Dialect
      Overrides:
      getUpsertAssembler in class StandardDialect
      Parameters:
      context - the UpsertAssemblerContext object
      Returns:
      the UpsertAssembler object for the given context
    • getInsertAssembler

      public <ENTITY> InsertAssembler getInsertAssembler(InsertAssemblerContext<ENTITY> context)
      Description copied from interface: Dialect
      Provides an implementation of InsertAssembler based on the given context.
      Specified by:
      getInsertAssembler in interface Dialect
      Overrides:
      getInsertAssembler in class StandardDialect
      Type Parameters:
      ENTITY - the type of the entity to be handled by the assembler
      Parameters:
      context - the context that holds the information required to create the InsertAssembler
      Returns:
      an instance of InsertAssembler specific to the provided entity context
    • getMultiInsertAssembler

      public <ENTITY> MultiInsertAssembler getMultiInsertAssembler(MultiInsertAssemblerContext<ENTITY> context)
      Description copied from interface: Dialect
      Provides an implementation of MultiInsertAssembler based on the given context.
      Specified by:
      getMultiInsertAssembler in interface Dialect
      Overrides:
      getMultiInsertAssembler in class StandardDialect
      Type Parameters:
      ENTITY - the type of the entity to be handled by the assembler
      Parameters:
      context - the context that holds the information required to create the MultiInsertAssembler
      Returns:
      an instance of MultiInsertAssembler specific to the provided entity context
    • getUpdateAssembler

      public <ENTITY> UpdateAssembler getUpdateAssembler(UpdateAssemblerContext<ENTITY> context)
      Description copied from interface: Dialect
      Provides an implementation of UpdateAssembler based on the given context.
      Specified by:
      getUpdateAssembler in interface Dialect
      Overrides:
      getUpdateAssembler in class StandardDialect
      Type Parameters:
      ENTITY - the type of the entity to be handled by the assembler
      Parameters:
      context - the context that holds the information required to create the UpdateAssembler
      Returns:
      an instance of UpdateAssembler specific to the provided entity context
    • getDeleteAssembler

      public <ENTITY> DeleteAssembler getDeleteAssembler(DeleteAssemblerContext<ENTITY> context)
      Description copied from interface: Dialect
      Provides an implementation of DeleteAssembler based on the given context.
      Specified by:
      getDeleteAssembler in interface Dialect
      Overrides:
      getDeleteAssembler in class StandardDialect
      Type Parameters:
      ENTITY - the type of the entity to be handled by the assembler
      Parameters:
      context - the context that holds the information required to create the DeleteAssembler
      Returns:
      an instance of DeleteAssembler specific to the provided entity context