@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface ChangeTemplate
All template classes must extend AbstractChangeTemplate and be annotated with
this annotation to specify whether they process single or multiple steps.
The id field is mandatory and must match the template: field in YAML
pipeline definitions. This decouples template identity from Java class naming.
Simple templates (default, multiStep = false):
id: create-users-table template: sql-template apply: "CREATE TABLE users (id INT PRIMARY KEY)" rollback: "DROP TABLE users"
Steppable templates (multiStep = true) process multiple operations:
id: setup-orders
template: mongo-template
steps:
- apply: { type: createCollection, collection: orders }
rollback: { type: dropCollection, collection: orders }
- apply: { type: insert, collection: orders, ... }
rollback: { type: delete, collection: orders, ... }
Steppable rollback behavior:
AbstractChangeTemplate| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
name
Unique identifier for this template.
|
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
multiStep
When
true, the template expects a steps array in YAML. |
java.lang.Class<?>[] |
reflectiveClasses
Classes that need reflection registration for GraalVM native image, beyond what is
already inferable from the template's generic type parameters (the configuration,
apply payload, and rollback payload classes are auto-registered by the framework).
|
boolean |
rollbackPayloadRequired
When
true (default), change authors must provide rollback payloads in YAML. |
public abstract java.lang.String name
template: field must match this ID.public abstract boolean multiStep
true, the template expects a steps array in YAML.
When false (default), it expects apply and optional rollback at root.true for steppable templates, false for simple templatespublic abstract boolean rollbackPayloadRequired
true (default), change authors must provide rollback payloads in YAML.
When false, rollback payloads are optional.true if rollback payloads are required, false otherwisepublic abstract java.lang.Class<?>[] reflectiveClasses
Use this when a template's apply/rollback methods touch classes that aren't part of its generic type signature — for example, a helper class instantiated reflectively inside the template body.
Defaults to empty. Most templates won't need to set it.