Class AbstractPostUpdateCustomizer
java.lang.Object
com.kingsrook.qqq.backend.core.actions.customizers.AbstractPostUpdateCustomizer
- All Implemented Interfaces:
TableCustomizerInterface
- Direct Known Subclasses:
HelpContentPostUpdateCustomizer
public abstract class AbstractPostUpdateCustomizer
extends Object
implements TableCustomizerInterface
Abstract class that a table can specify an implementation of, to provide
custom actions after an update takes place.
General implementation would be, to iterate over the records (the outputs of
the update action), 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 update, and instead
will just set a warning on all of the updated 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.
Note that the full updateInput is available as a field in this class, and the
"old records" (e.g., with values freshly fetched from the backend) will be
available (if the backend supports it) - both as a list (`getOldRecordList`)
and as a memoized (by this class) map of primaryKey to record (`getOldRecordMap`).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizerInterface
TableCustomizerInterface.NotImplementedHereException
-
Field Summary
FieldsFields inherited from interface com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizerInterface
LOG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map
<Serializable, QRecord> Getter for updateInputpostUpdate
(UpdateInput updateInput, List<QRecord> records, Optional<List<QRecord>> oldRecordList) custom actions after an update takes place.void
setOldRecordList
(List<QRecord> oldRecordList) void
setUpdateInput
(UpdateInput updateInput) Setter for updateInputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.kingsrook.qqq.backend.core.actions.customizers.TableCustomizerInterface
oldRecordListToMap, postDelete, postInsert, postInsertOrUpdate, postQuery, preDelete, preInsert, preInsertOrUpdate, preUpdate, whenToRunPreInsert
-
Field Details
-
updateInput
-
oldRecordList
-
-
Constructor Details
-
AbstractPostUpdateCustomizer
public AbstractPostUpdateCustomizer()
-
-
Method Details
-
postUpdate
public List<QRecord> postUpdate(UpdateInput updateInput, List<QRecord> records, Optional<List<QRecord>> oldRecordList) throws QException Description copied from interface:TableCustomizerInterface
custom actions after an update takes place. General implementation would be, to iterate over the records (the outputs of the update action), 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 update, and instead will just set a warning on all of the updated 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. Note, "old records" (e.g., with values freshly fetched from the backend) will be available (if the backend supports it).- Specified by:
postUpdate
in interfaceTableCustomizerInterface
- Throws:
QException
-
apply
- Throws:
QException
-
getUpdateInput
Getter for updateInput -
setUpdateInput
Setter for updateInput -
setOldRecordList
-
getOldRecordList
-
getOldRecordMap
-