Class MsTrigger
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsAbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsTrigger
- All Implemented Interfaces:
ISearchPath,IStatement,ISubElement,ITrigger,MsSourceStatement,IHashable
Represents a Microsoft SQL trigger that executes in response to specific database events.
Triggers can be enabled or disabled and support ANSI_NULLS and QUOTED_IDENTIFIER settings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendAlterSQL(IStatement newCondition, SQLScript script) Fill script with object changes and return change typevoidAppends the only normalized statement part: its name and location, always qualifies and quotes.booleanChecks if this statement can be dropped before being recreated.booleancompare(IStatement obj) This method does not account for nested child PgStatements.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.Gets the first part of the source statement (before CREATE/ALTER).Gets the second part of the source statement (after the object name).voidsetAnsiNulls(boolean ansiNulls) voidsetDisable(boolean isDisable) voidsetFirstPart(String firstPart) Sets the first part of the source statement.voidsetQuotedIdentified(boolean quotedIdentified) voidsetSecondPart(String secondPart) Sets the second part of the source statement.Methods inherited from class org.pgcodekeeper.core.database.ms.schema.MsAbstractStatement
appendOwnerSQL, formatSql, getQuoter, getRenameCommand, getSeparator, isOwnedMethods inherited from class org.pgcodekeeper.core.database.base.schema.AbstractStatement
addDependency, addPrivilege, appendAlterComments, appendComments, appendPrivileges, canDrop, checkComments, clearPrivileges, compareChildren, deepCopy, equals, fillChildrenList, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, hasChildren, hashCode, isLib, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, shallowCopy, toStringMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendOwnerSQL, canDrop, clearPrivileges, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQualifiedName, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopyMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISubElement
getContainingSchema, toObjectReferenceMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ITrigger
getStatementTypeMethods inherited from interface org.pgcodekeeper.core.database.ms.schema.MsSourceStatement
appendSourceStatement
-
Constructor Details
-
MsTrigger
Creates a new Microsoft SQL trigger.- Parameters:
name- the trigger name
-
-
Method Details
-
getCreationSQL
Description copied from interface:IStatementGenerates the SQL statements needed to create this database object. This is an abstract method that must be implemented by subclasses to provide the specific CREATE SQL for each object type.- Specified by:
getCreationSQLin interfaceIStatement- Parameters:
script- the SQL script to append creation statements to
-
appendName
Description copied from interface:MsSourceStatementAppends the only normalized statement part: its name and location, always qualifies and quotes.- Specified by:
appendNamein interfaceMsSourceStatement
-
appendAlterSQL
Description copied from interface:IStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin interfaceIStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
appendFullName
-
canDropBeforeCreate
public boolean canDropBeforeCreate()Description copied from interface:IStatementChecks if this statement can be dropped before being recreated. Override in subclasses that support drop-before-create behavior.- Specified by:
canDropBeforeCreatein interfaceIStatement- Overrides:
canDropBeforeCreatein classAbstractStatement- Returns:
- true if the statement can be dropped before recreation
-
setAnsiNulls
public void setAnsiNulls(boolean ansiNulls) -
setQuotedIdentified
public void setQuotedIdentified(boolean quotedIdentified) -
setDisable
public void setDisable(boolean isDisable) -
getFirstPart
Description copied from interface:MsSourceStatementGets the first part of the source statement (before CREATE/ALTER).- Specified by:
getFirstPartin interfaceMsSourceStatement- Returns:
- the first part of the source
-
setFirstPart
Description copied from interface:MsSourceStatementSets the first part of the source statement.- Specified by:
setFirstPartin interfaceMsSourceStatement- Parameters:
firstPart- the first part to set
-
getSecondPart
Description copied from interface:MsSourceStatementGets the second part of the source statement (after the object name).- Specified by:
getSecondPartin interfaceMsSourceStatement- Returns:
- the second part of the source
-
setSecondPart
Description copied from interface:MsSourceStatementSets the second part of the source statement.- Specified by:
setSecondPartin interfaceMsSourceStatement- Parameters:
secondPart- the second part to set
-
computeHash
Description copied from interface:IHashableComputes the hash of the implementing object using the provided hasher. The implementation should call appropriateputmethods on the hasher for all fields that should contribute to the hash value.- Specified by:
computeHashin interfaceIHashable- Parameters:
hasher- the hasher instance to use for hash computation
-
compare
Description copied from class:AbstractStatementThis method does not account for nested child PgStatements. Shallow version ofAbstractStatement.equals(Object)- Specified by:
comparein interfaceIStatement- Overrides:
comparein classAbstractStatement
-