Class UpdateSetStep<DTO,US extends UpdateStep<DTO,US,SELF,WCC,WCCT,QCB>,SELF extends UpdateSetStep<DTO,US,SELF,WCC,WCCT,QCB>,WCC extends UpdateWhereConditionClause<DTO,WCC,WCCT,QCB>,WCCT extends UpdateWhereConditionClauseTerminal<DTO,WCC,WCCT,QCB>,QCB extends QueryConditionBuilder<DTO,?,?,?,QCB>>

java.lang.Object
org.litebridge.orm.api.update.UpdateSetStep<DTO,US,SELF,WCC,WCCT,QCB>
Type Parameters:
DTO - the mapped DTO/entity type or row type
US - the update step type returned after setting a value
WCC - the where condition clause type
WCCT - the where condition clause terminal type
Direct Known Subclasses:
DtoUpdateSetStep, SqlUpdateSetStep

public abstract sealed class UpdateSetStep<DTO,US extends UpdateStep<DTO,US,SELF,WCC,WCCT,QCB>,SELF extends UpdateSetStep<DTO,US,SELF,WCC,WCCT,QCB>,WCC extends UpdateWhereConditionClause<DTO,WCC,WCCT,QCB>,WCCT extends UpdateWhereConditionClauseTerminal<DTO,WCC,WCCT,QCB>,QCB extends QueryConditionBuilder<DTO,?,?,?,QCB>> extends Object permits DtoUpdateSetStep<DTO>, SqlUpdateSetStep
Base step for specifying the value of a column or expression in a SET clause.
  • Constructor Details

    • UpdateSetStep

      protected UpdateSetStep(String column, QueryNode node, Function<QueryNode,US> updateStepCreator)
      Creates a new UpdateSetStep instance with a column or field name.
      Parameters:
      column - the column or field name to update
      node - the current query node
      updateStepCreator - the function to create the update step
    • UpdateSetStep

      protected UpdateSetStep(ExpressionSpec expressionSpec, QueryNode node, Function<QueryNode,US> updateStepCreator)
      Creates a new UpdateSetStep instance with an expression specification.
      Parameters:
      expressionSpec - the expression specification defining the column or target
      node - the current query node
      updateStepCreator - the function to create the update step
  • Method Details

    • to

      public US to(@Nullable Object value)
      Sets the target column or field to the specified value.
      Parameters:
      value - the value to set
      Returns:
      the next update step
    • increment

      public US increment()
      Increments the target column or field by 1.
      Returns:
      the next update step
    • add

      public US add(Object value)
      Adds the specified value to the target column or field.
      Parameters:
      value - the value to add
      Returns:
      the next update step
    • minus

      public US minus(Object value)
      Subtracts the specified value from the target column or field.
      Parameters:
      value - the value to subtract
      Returns:
      the next update step
    • multiply

      public US multiply(Object value)
      Multiplies the target column or field by the specified value.
      Parameters:
      value - the value to multiply by
      Returns:
      the next update step
    • divide

      public US divide(Object value)
      Divides the target column or field by the specified value.
      Parameters:
      value - the divisor value
      Returns:
      the next update step
    • mod

      public US mod(Object value)
      Applies a modulo operation to the target column or field with the specified value.
      Parameters:
      value - the modulus value
      Returns:
      the next update step