SHARED_CONFIG - the type of shared configurationAPPLY - the type of the apply payloadROLLBACK - the type of the rollback payloadpublic abstract class AbstractSimpleTemplate<SHARED_CONFIG,APPLY,ROLLBACK> extends AbstractChangeTemplate<SHARED_CONFIG,APPLY,ROLLBACK>
Use this class when your template processes a single operation that may have an optional rollback. The YAML structure for this template type is:
id: create-users-table
template: SqlTemplate
apply: "CREATE TABLE users ..."
rollback: "DROP TABLE users"
The framework will automatically create a TemplateStep from the
apply/rollback fields in the YAML and inject it via setStep(io.flamingock.api.template.TemplateStep<APPLY, ROLLBACK>).
| Modifier and Type | Field and Description |
|---|---|
protected TemplateStep<APPLY,ROLLBACK> |
step |
changeId, configuration, isTransactional| Constructor and Description |
|---|
AbstractSimpleTemplate(java.lang.Class<?>... additionalReflectiveClass) |
| Modifier and Type | Method and Description |
|---|---|
APPLY |
getApply()
Convenience method to get the apply payload from the step.
|
ROLLBACK |
getRollback()
Convenience method to get the rollback payload from the step.
|
TemplateStep<APPLY,ROLLBACK> |
getStep()
Returns the step containing the apply and optional rollback payloads.
|
boolean |
hasRollback()
Checks if this template has a rollback payload defined.
|
boolean |
hasStep()
Checks if this template has a step set.
|
void |
setStep(TemplateStep<APPLY,ROLLBACK> step)
Sets the step containing the apply and optional rollback payloads.
|
getApplyPayloadClass, getConfigurationClass, getReflectiveClasses, getRollbackPayloadClass, setChangeId, setConfiguration, setTransactionalprotected TemplateStep<APPLY,ROLLBACK> step
public AbstractSimpleTemplate(java.lang.Class<?>... additionalReflectiveClass)
public void setStep(TemplateStep<APPLY,ROLLBACK> step)
step - the template steppublic TemplateStep<APPLY,ROLLBACK> getStep()
public boolean hasStep()
public APPLY getApply()
public ROLLBACK getRollback()
public boolean hasRollback()