Class AbstractPostDeleteCustomizer

java.lang.Object
com.kingsrook.qqq.backend.core.actions.customizers.AbstractPostDeleteCustomizer
All Implemented Interfaces:
TableCustomizerInterface

public abstract class AbstractPostDeleteCustomizer extends Object implements TableCustomizerInterface
Abstract class that a table can specify an implementation of, to provide custom actions after a delete takes place. General implementation would be, to iterate over the records (ones which didn't have a delete error), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records? - possibly throwing an exception - though doing so won't stop the delete, and instead will just set a warning on all of the deleted records... - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go back to the caller - this is how errors and warnings are propagated . Note that the full deleteInput is available as a field in this class. A future enhancement here may be to take (as fields in this class) the list of records that the delete action marked in error - the user might want to do something special with them (idk, try some other way to delete them?)
  • Field Details

  • Constructor Details

    • AbstractPostDeleteCustomizer

      public AbstractPostDeleteCustomizer()
  • Method Details

    • postDelete

      public List<QRecord> postDelete(DeleteInput deleteInput, List<QRecord> records) throws QException
      Description copied from interface: TableCustomizerInterface
      Custom actions after a delete takes place. General implementation would be, to iterate over the records (ones which didn't have a delete error), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records? - possibly throwing an exception - though doing so won't stop the delete, and instead will just set a warning on all of the deleted records... - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go back to the caller - this is how errors and warnings are propagated .
      Specified by:
      postDelete in interface TableCustomizerInterface
      Throws:
      QException
    • apply

      public abstract List<QRecord> apply(List<QRecord> records) throws QException
      Throws:
      QException
    • getDeleteInput

      public DeleteInput getDeleteInput()
      Getter for deleteInput
    • setDeleteInput

      public void setDeleteInput(DeleteInput deleteInput)
      Setter for deleteInput