Class MergeOnStep<DTO,MCCT extends MergeOnConditionClauseTerminal<DTO,MCCT,MUS,MIS,QCB>,MUS extends MergeUpdateStep,MIS extends MergeInsertStep,QCB extends QueryConditionBuilder<DTO,?,?,?,QCB>>

java.lang.Object
org.litebridge.orm.api.merge.MergeOnStep<DTO,MCCT,MUS,MIS,QCB>
Type Parameters:
DTO - the type of the DTO
MUS - operation mode-specific WHEN MATCHED update step
MIS - operation mode-specific WHEN NOT MATCHED insert step
Direct Known Subclasses:
DtoMergeOnStep, SqlMergeOnStep

public abstract sealed class MergeOnStep<DTO,MCCT extends MergeOnConditionClauseTerminal<DTO,MCCT,MUS,MIS,QCB>,MUS extends MergeUpdateStep,MIS extends MergeInsertStep,QCB extends QueryConditionBuilder<DTO,?,?,?,QCB>> extends Object permits DtoMergeOnStep<DTO>, SqlMergeOnStep
Merge step for setting up the MERGE INTO ... USING ... ON condition.
  • Field Details

    • usingAlias

      protected final @Nullable String usingAlias
    • mergeNode

      protected final MergeNode mergeNode
      The root merge node containing target table information
    • usingTable

      protected final @Nullable String usingTable
      The using table name in SQL mode.
    • usingDtoClass

      protected final @Nullable Class<?> usingDtoClass
      The using DTO class in DTO mode.
    • usingQueryNode

      protected final @Nullable QueryNode usingQueryNode
      The using sub-query's terminal node
    • usingValues

      protected final @Nullable ValuesSpec usingValues
      Using VALUES
    • litebridgeContext

      protected final LitebridgeContext litebridgeContext
      The Litebridge context.
  • Constructor Details

    • MergeOnStep

      public MergeOnStep(String usingTable, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext)
      Creates a new MergeOnStep instance for SQL mode.
      Parameters:
      usingTable - the merge using table
      mergeNode - the root merge node
      litebridgeContext - Litebridge context
    • MergeOnStep

      public MergeOnStep(QueryNode subselectNode, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext)
      Creates a new MergeOnStep instance.
      Parameters:
      subselectNode - Subquery to merge on.
      mergeNode - the root merge node
      litebridgeContext - the Litebridge context
    • MergeOnStep

      protected MergeOnStep(Class<?> usingDtoClass, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext)
      Creates a new MergeOnStep instance for DTO mode.
      Parameters:
      usingDtoClass - the using DTO class
      mergeNode - the root merge node
      litebridgeContext - the Litebridge context
    • MergeOnStep

      protected MergeOnStep(ValuesSpec valuesSpec, MergeNode mergeNode, LitebridgeContext litebridgeContext)
      Creates a new MergeOnStep instance.
      Parameters:
      valuesSpec - Values from target specification
      mergeNode - the root merge node
      litebridgeContext - the Litebridge context
  • Method Details

    • on

      public MergeConditionClause<DTO,MUS,MCCT,QCB> on(String column)
      Creates a MERGE INTO ... USING ... ON condition targeting the specified column.
      Parameters:
      column - the LHS column of the ON condition
      Returns:
      the next step in the update operation: setting the value of the target column
    • on

      Creates a MERGE INTO ... USING ... ON condition using an expression.
      Parameters:
      expression - expression specifying the target LHS column of the ON condition
      Returns:
      the next step in the update operation: setting the value of the target column
    • on

      public abstract MCCT on(QCB query)
      Creates a MERGE INTO ... USING ... ON condition using a nested condition block.
      Parameters:
      query - the query condition builder
      Returns:
      the condition clause terminal
    • createMergeOnConditionClauseTerminal

      protected abstract MCCT createMergeOnConditionClauseTerminal(QueryNode conditionNode, @Nullable String alias)
    • usingTable

      protected String usingTable()