Class MergeUsing


public final class MergeUsing extends DataChangeStatement
This class represents the statement syntax MERGE INTO table alias USING... It does not replace the MERGE INTO... KEYS... form.
  • Field Details

    • targetTableFilter

      TableFilter targetTableFilter
      Target table filter.
    • sourceTableFilter

      TableFilter sourceTableFilter
      Source table filter.
    • onCondition

      Expression onCondition
      ON condition expression.
    • when

      private ArrayList<MergeUsing.When> when
    • targetRowidsRemembered

      private final HashSet<Long> targetRowidsRemembered
      Contains _ROWID_ of processed rows. Row identities are remembered to prevent duplicate updates of the same row.
  • Constructor Details

  • Method Details

    • update

      public long update(ResultTarget deltaChangeCollector, DataChangeDeltaTable.ResultOption deltaChangeCollectionMode)
      Description copied from class: DataChangeStatement
      Execute the statement with specified delta change collector and collection mode.
      Specified by:
      update in class DataChangeStatement
      Parameters:
      deltaChangeCollector - target result
      deltaChangeCollectionMode - collection mode
      Returns:
      the update count
    • merge

      private int merge(boolean nullRow, ResultTarget deltaChangeCollector, DataChangeDeltaTable.ResultOption deltaChangeCollectionMode)
    • evaluateTriggerMasks

      private int evaluateTriggerMasks()
    • checkRights

      private void checkRights()
    • getPlanSQL

      public String getPlanSQL(int sqlFlags)
      Description copied from class: Prepared
      Get the SQL statement with the execution plan.
      Overrides:
      getPlanSQL in class Prepared
      Parameters:
      sqlFlags - formatting flags
      Returns:
      the execution plan
    • prepare

      public void prepare()
      Description copied from class: Prepared
      Prepare this statement.
      Overrides:
      prepare in class Prepared
    • setSourceTableFilter

      public void setSourceTableFilter(TableFilter sourceTableFilter)
    • getSourceTableFilter

      public TableFilter getSourceTableFilter()
    • setOnCondition

      public void setOnCondition(Expression condition)
    • getOnCondition

      public Expression getOnCondition()
    • getWhen

      public ArrayList<MergeUsing.When> getWhen()
    • addWhen

      public void addWhen(MergeUsing.When w)
      Adds WHEN command.
      Parameters:
      w - new WHEN command to add (update, delete or insert).
    • getTable

      public Table getTable()
      Description copied from class: DataChangeStatement
      Return the target table.
      Specified by:
      getTable in class DataChangeStatement
      Returns:
      the target table
    • setTargetTableFilter

      public void setTargetTableFilter(TableFilter targetTableFilter)
    • getTargetTableFilter

      public TableFilter getTargetTableFilter()
    • getType

      public int getType()
      Description copied from class: Prepared
      Get the command type as defined in CommandInterface
      Specified by:
      getType in class Prepared
      Returns:
      the statement type
    • getStatementName

      public String getStatementName()
      Description copied from class: DataChangeStatement
      Return the name of this statement.
      Specified by:
      getStatementName in class DataChangeStatement
      Returns:
      the short name of this statement.
    • collectDependencies

      public void collectDependencies(HashSet<DbObject> dependencies)
      Description copied from class: Prepared
      Find and collect all DbObjects, this Prepared depends on.
      Overrides:
      collectDependencies in class Prepared
      Parameters:
      dependencies - collection of dependencies to populate