Package org.pgcodekeeper.core.schema.ms
Class MsTrigger
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractTrigger
org.pgcodekeeper.core.schema.ms.MsTrigger
- All Implemented Interfaces:
IHashable,ISearchPath,IStatement,SourceStatement
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.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendAlterSQL(PgStatement newCondition, SQLScript script) Fill script with object changes and return change typeAppends the only normalized statement part: its name and location, always qualifies and quotes.booleanChecks if this statement can be dropped before being recreated.booleancompare(PgStatement 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.schema.AbstractTrigger
getContainingSchema, getStatementType, isSubElement, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDrop, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getContainingSchema, getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName, getStatementTypeMethods inherited from interface org.pgcodekeeper.core.schema.SourceStatement
appendSourceStatement
-
Constructor Details
-
MsTrigger
Creates a new Microsoft SQL trigger.- Parameters:
name- the trigger name
-
-
Method Details
-
getCreationSQL
Description copied from class:PgStatementGenerates 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 classPgStatement- Parameters:
script- the SQL script to append creation statements to
-
appendName
Description copied from interface:SourceStatementAppends the only normalized statement part: its name and location, always qualifies and quotes.- Specified by:
appendNamein interfaceSourceStatement
-
appendAlterSQL
Description copied from class:PgStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin classPgStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
canDropBeforeCreate
public boolean canDropBeforeCreate()Description copied from class:PgStatementChecks if this statement can be dropped before being recreated. Override in subclasses that support drop-before-create behavior.- Overrides:
canDropBeforeCreatein classPgStatement- Returns:
- true if the statement can be dropped before recreation
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classPgStatement
-
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
-
setAnsiNulls
public void setAnsiNulls(boolean ansiNulls) -
setQuotedIdentified
public void setQuotedIdentified(boolean quotedIdentified) -
setDisable
public void setDisable(boolean isDisable) -
getFirstPart
Description copied from interface:SourceStatementGets the first part of the source statement (before CREATE/ALTER).- Specified by:
getFirstPartin interfaceSourceStatement- Returns:
- the first part of the source
-
setFirstPart
Description copied from interface:SourceStatementSets the first part of the source statement.- Specified by:
setFirstPartin interfaceSourceStatement- Parameters:
firstPart- the first part to set
-
getSecondPart
Description copied from interface:SourceStatementGets the second part of the source statement (after the object name).- Specified by:
getSecondPartin interfaceSourceStatement- Returns:
- the second part of the source
-
setSecondPart
Description copied from interface:SourceStatementSets the second part of the source statement.- Specified by:
setSecondPartin interfaceSourceStatement- Parameters:
secondPart- the second part to set
-
getDbType
- Overrides:
getDbTypein classPgStatement
-