Interface CriteriaBuilder

All Known Implementing Classes:
Db2Dialect.Db2CriteriaBuilder, Mssql2008Dialect.Mssql2008CriteriaBuilder, MysqlDialect.MysqlCriteriaBuilder, Oracle11Dialect.Oracle11CriteriaBuilder, PostgresDialect.PostgresCriteriaBuilder, SqliteDialect.SqliteCriteriaBuilder, StandardDialect.StandardCriteriaBuilder

public interface CriteriaBuilder
A builder interface for database-specific SQL criteria operations.

This interface provides methods to build SQL fragments that are specific to each database dialect, such as pagination, string concatenation, and locking operations. Implementations are provided by each database dialect.

See Also:
  • Method Details

    • concat

      void concat(PreparedSqlBuilder buf, Runnable leftOperand, Runnable rightOperand)
      Builds a SQL fragment for string concatenation operation.
      Parameters:
      buf - the SQL builder to append the concatenation expression to
      leftOperand - the runnable that builds the left operand of the concatenation
      rightOperand - the runnable that builds the right operand of the concatenation
    • offsetAndFetch

      void offsetAndFetch(PreparedSqlBuilder buf, int offset, int limit)
      Builds a SQL fragment for pagination with offset and limit.
      Parameters:
      buf - the SQL builder to append the pagination expression to
      offset - the number of rows to skip
      limit - the maximum number of rows to return
    • lockWithTableHint

      void lockWithTableHint(PreparedSqlBuilder buf, ForUpdateOption option, Consumer<PropertyMetamodel<?>> column)
      Builds a SQL fragment for locking using table hints.
      Parameters:
      buf - the SQL builder to append the locking expression to
      option - the locking options
      column - the consumer that specifies which columns to lock
    • forUpdate

      void forUpdate(PreparedSqlBuilder buf, ForUpdateOption option, Consumer<PropertyMetamodel<?>> column, AliasManager aliasManager)
      Builds a SQL fragment for FOR UPDATE clause.
      Parameters:
      buf - the SQL builder to append the FOR UPDATE expression to
      option - the FOR UPDATE options
      column - the consumer that specifies which columns to lock
      aliasManager - the manager for table aliases