Class MsView
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsAbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsAbstractStatementContainer
org.pgcodekeeper.core.database.ms.schema.MsView
- All Implemented Interfaces:
IRelation,ISearchPath,IStatement,IStatementContainer,IView,MsSourceStatement,IHashable
Represents a Microsoft SQL view with support for schema binding,
ANSI_NULLS and QUOTED_IDENTIFIER settings, and statistics.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendAlterSQL(IStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleanChecks 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 columns of this relation as name-type pairs.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.database.ms.schema.MsAbstractStatementContainer
addChild, compareChildren, computeChildrenHash, fillChildrenList, getChild, getChildrenByType, getTrigger, isClusteredMethods 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, deepCopy, equals, 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
getContainingSchema, getDatabase, getSchemaName, toObjectReferenceMethods 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.IStatementContainer
addChild, getChild, getChildrenByTypeMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IView
getStatementTypeMethods inherited from interface org.pgcodekeeper.core.database.ms.schema.MsSourceStatement
appendName, appendSourceStatement
-
Constructor Details
-
MsView
Creates a new Microsoft SQL view.- Parameters:
name- the view 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
-
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
-
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) -
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
-
setSchemaBinding
public void setSchemaBinding(boolean schemaBinding) -
isSchemaBinding
public boolean isSchemaBinding() -
getRelationColumns
Description copied from interface:IRelationGets the columns of this relation as name-type pairs.- Specified by:
getRelationColumnsin interfaceIRelation- Returns:
- a stream of column name and type pairs
-
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
-