Package org.pgcodekeeper.core.schema.ms
Class MsView
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.PgStatementContainer
org.pgcodekeeper.core.schema.AbstractView
org.pgcodekeeper.core.schema.ms.MsView
- All Implemented Interfaces:
IHashable,IRelation,ISearchPath,IStatement,IStatementContainer,SourceStatement
Represents a Microsoft SQL view with support for schema binding,
ANSI_NULLS and QUOTED_IDENTIFIER settings, and statistics.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(IStatement st) Adds a child statement to this container.appendAlterSQL(PgStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleanChecks if this statement can be dropped before being recreated.booleancompare(PgStatement obj) This method does not account for nested child PgStatements.booleanDeep part ofPgStatement.equals(Object).voidcomputeChildrenHash(Hasher hasher) voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.Gets a child statement by name and type.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).booleanvoidsetAnsiNulls(boolean ansiNulls) voidsetFirstPart(String firstPart) Sets the first part of the source statement.voidsetQuotedIdentified(boolean quotedIdentified) voidsetSchemaBinding(boolean schemaBinding) voidsetSecondPart(String secondPart) Sets the second part of the source statement.Methods inherited from class org.pgcodekeeper.core.schema.AbstractView
addConstraint, getConstraint, getConstraints, getRelationColumns, getStatementTypeMethods inherited from class org.pgcodekeeper.core.schema.PgStatementContainer
addIndex, addPolicy, addRule, addTrigger, getContainingSchema, getIndex, getIndexes, getPolicies, getPolicy, getRule, getRules, getTrigger, getTriggers, isClustered, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDrop, checkComments, clearPrivileges, 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, isSubElement, 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
appendName, appendSourceStatement
-
Constructor Details
-
MsView
Creates a new Microsoft SQL view.- Parameters:
name- the view 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
-
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 classAbstractView
-
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
-
addChild
Description copied from interface:IStatementContainerAdds a child statement to this container.- Specified by:
addChildin interfaceIStatementContainer- Overrides:
addChildin classPgStatementContainer- Parameters:
st- the child statement to add
-
getChild
Description copied from interface:IStatementContainerGets a child statement by name and type.- Specified by:
getChildin interfaceIStatementContainer- Overrides:
getChildin classPgStatementContainer- Parameters:
name- the name of the child to findtype- the type of the child to find- Returns:
- the child statement, or null if not found
-
compareChildren
Description copied from class:PgStatementDeep part ofPgStatement.equals(Object). Compares all object's child PgStatements for equality.- Overrides:
compareChildrenin classPgStatementContainer
-
computeChildrenHash
- Overrides:
computeChildrenHashin classPgStatementContainer
-
setAnsiNulls
public void setAnsiNulls(boolean ansiNulls) -
setQuotedIdentified
public void setQuotedIdentified(boolean quotedIdentified) -
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
-
setSchemaBinding
public void setSchemaBinding(boolean schemaBinding) -
isSchemaBinding
public boolean isSchemaBinding() -
getDbType
- Overrides:
getDbTypein classPgStatement
-