Class DeleteFromJDBC

All Implemented Interfaces:
ConnectionSettings, LogicalOperator, PipelineOperator<RecordPort>, RecordPipelineOperator

public final class DeleteFromJDBC extends AbstractWriteToJDBC implements RecordPipelineOperator
This operator deletes data in the target table in a database by applying SQL delete statements. This operator will additionally copy the used input to an output port that will contain an additional status field indicating whether the delete succeeded for that row and how many rows in the target table were deleted by it. The operator will use the input data rows to create database delete statements. The key fields provided in the input data rows will be used to find matching rows to delete from the target table. Key fields must be specified in the operator properties. Key field values will be used within generated database delete statements. Initial and final SQL statements can be provided. The initial statement is run before any input data is handled. The final statement is executed after all input data has been processed. Note that the DeleteFromJDBC operator is parallelized. Each parallel instance will open a separate connection to the target database. To limit the number of database connections used by this operator, tune down the operator parallelism level. To set the parallelism level create an OperatorSettings instance with maximum parallelism set to the wanted level. The operator settings can then be passed as a parameter to the LogicalGraph#add(com.pervasive.datarush.operators.LogicalOperator, OperatorSettings) method.
  • Constructor Details

    • DeleteFromJDBC

      public DeleteFromJDBC()
      Default constructor.
    • DeleteFromJDBC

      public DeleteFromJDBC(DeleteFromJDBC other)
      Copy constructor.
      Parameters:
      other - the other instance of WriteToJDBC
  • Method Details

    • setStatusField

      public void setStatusField(String statusField)
      Set the name of the field that will contain the update status. Defaults to Updated.
      Parameters:
      statusField - name of the status field in the output
    • getStatusField

      public String getStatusField()
      Get the name of the field that will contain the update status.
      Returns:
      name of the status field in the output
    • getOutput

      public RecordPort getOutput()
      Get the output port containing the statues received from the database.
      Specified by:
      getOutput in interface PipelineOperator<RecordPort>
      Returns:
      output record port
    • compose

      protected void compose(CompositionContext ctx)
      Description copied from class: CompositeOperator
      Compose the body of this operator. Implementations should do the following:
      1. Perform any validation of configuration, input types, etc
      2. Instantiate and configure sub-operators, adding them to the provided context via the method OperatorComposable.add(O)
      3. Create necessary connections via the method OperatorComposable.connect(P, P). This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
      Specified by:
      compose in class CompositeOperator
      Parameters:
      ctx - the context