Package org.pgcodekeeper.core.schema
Interface SourceStatement
- All Superinterfaces:
ISearchPath,IStatement
- All Known Implementing Classes:
AbstractMsFunction,MsFunction,MsProcedure,MsTrigger,MsView
Interface for database statements that are represented by their full source code.
The source is separated into two parts by the CREATE/ALTER statement keywords,
allowing for flexible SQL generation while preserving the original formatting.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringBuilderAppends the only normalized statement part: its name and location, always qualifies and quotes.default voidappendSourceStatement(boolean isCreate, StringBuilder sb) Assembles entire statement from source partsGets the first part of the source statement (before CREATE/ALTER).Gets the second part of the source statement (after the object name).voidsetFirstPart(String firstPart) Sets the first part of the source statement.voidsetSecondPart(String secondPart) Sets the second part of the source statement.Methods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getContainingSchema, getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName, getStatementType
-
Method Details
-
getFirstPart
String getFirstPart()Gets the first part of the source statement (before CREATE/ALTER).- Returns:
- the first part of the source
-
setFirstPart
Sets the first part of the source statement.- Parameters:
firstPart- the first part to set
-
getSecondPart
String getSecondPart()Gets the second part of the source statement (after the object name).- Returns:
- the second part of the source
-
setSecondPart
Sets the second part of the source statement.- Parameters:
secondPart- the second part to set
-
appendSourceStatement
Assembles entire statement from source parts- Parameters:
isCreate- do CREATE or ALTER
-
appendName
Appends the only normalized statement part: its name and location, always qualifies and quotes.
-