Package ch.tocco.nice2.dbrefactoring.spi
Class CustomChangelog
java.lang.Object
ch.tocco.nice2.dbrefactoring.spi.CustomChangelog
Interface to modify a database changelog. It manages two changesets, one for schema definitions
and one for schema constraints. They both are marked by different context names to have them run
independently.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddCommentNode(String text) Adds a xml comment node to the current changeset, or if this is null, to the root node.voidaddInclude(String file) voidappendChangeset(String name) If the current changeset has been created withaddToRoot=false, use this to finally append the changeset to the root node.booleanchangesetExists(String name) static CustomChangelogcreate(Changelog.Xsd xsd) createChangeset(String name) Creates a new changeset and adds it to the root node.createChangeset(String name, boolean addToRoot) Creates a new changeset which is set as "current changeset".createChangeset(String name, @Nullable String context) Creates a new changeset and adds it to the root node.createChangeset(String name, @Nullable String context, boolean addToRoot) Creates a new changeset which is set as "current changeset".static CustomChangelogReturns the changelog document.getChangeset(String name) Collection<? extends Changeset> booleanisChangesetAppended(String name) Checks whether the current changeset is appended to the root node of the document.
-
Method Details
-
create
-
createFromChangelog
-
getChangelog
Returns the changelog document. -
createChangeset
Creates a new changeset and adds it to the root node.- Parameters:
name- the name of the changeset, which is part of its id attribute- Returns:
- this
-
createChangeset
Creates a new changeset and adds it to the root node.- Parameters:
name- the name of the changeset, which is part of its id attributecontext- the context of the changeset- Returns:
- this
-
createChangeset
Creates a new changeset which is set as "current changeset". All other operations use this changeset to add tags.- Parameters:
name- the name of the changeset, this is part of the id attributeaddToRoot- iftrue, the new changeset is added to the root node of the document immediately @return this
-
createChangeset
public Changeset createChangeset(String name, @Nullable @Nullable String context, boolean addToRoot) throws DbRefactoringException Creates a new changeset which is set as "current changeset". All other operations use this changeset to add tags.- Parameters:
name- the name of the changeset, this is part of the id attributecontext- the context of the changesetaddToRoot- iftrue, the new changeset is added to the root node of the document immediately @return this- Throws:
DbRefactoringException
-
appendChangeset
If the current changeset has been created withaddToRoot=false, use this to finally append the changeset to the root node. After this, a new changeset can be created usingcreateChangeset(String)orcreateChangeset(String, boolean), resp. A runtime exception is thrown, if the changeset has already added to the root node. UseisChangesetAppended(String)to check, if unsure. -
changesetExists
-
isChangesetAppended
Checks whether the current changeset is appended to the root node of the document. -
getChangeset
- Throws:
DbRefactoringException
-
addCommentNode
Adds a xml comment node to the current changeset, or if this is null, to the root node. -
addInclude
-
getChangesets
-
addChangeset
-