Class BatchQueryOperation


public class BatchQueryOperation extends QueryOperation
For use with a batch SQL query, i.e. two or more SQL statements that are to be executed against the database in order. The result will be either 0 (success) or 1 (failure). Note that if a statement fails, i.e. an exception is thrown upon executing a given SQL statement, none of the remaining statements are executed. Warning: the SQL is assumed to be valid and well formed, and no roll back or any type of error handling is performed.
  • Field Details

  • Constructor Details

    • BatchQueryOperation

      public BatchQueryOperation()
  • Method Details

    • getBatchSql

      public List<String> getBatchSql()
      Return the List of SQL statements to be executed for this operation.
    • setBatchSql

      public void setBatchSql(List<String> batchSql)
      Set the List of SQL statements to be executed for this operation.
    • invoke

      public Object invoke(XRServiceAdapter xrService, Invocation invocation)
      Invoke the SQL statements in order against the database. The returned ValueOject will hold either 0 (success) or 1 (failure).
      Overrides:
      invoke in class QueryOperation
      Parameters:
      xrService - parent XRService that owns this Operation
      invocation - contains runtime argument values to be bound to the list of Parameter's.
      Returns:
      result - the result of the underlying SELECT operation on the database, or null.
      See Also:
    • validate

      public void validate(XRServiceAdapter xrService)
      No validation can be done for a batch query operation.
      Overrides:
      validate in class QueryOperation
    • initialize

      public void initialize(XRServiceAdapter xrService)
      The initialize method will add an XMLDesctriptor for org.eclipse.persistence.internal.xr.ValueObject to the OX project. This class is used to hold the result of the batch SQL execution.
      Overrides:
      initialize in class QueryOperation