Package ru.curs.celesta.score
Class MaterializedView
- java.lang.Object
-
- ru.curs.celesta.score.NamedElement
-
- ru.curs.celesta.score.GrainElement
-
- ru.curs.celesta.score.DataGrainElement
-
- ru.curs.celesta.score.AbstractView
-
- ru.curs.celesta.score.MaterializedView
-
- All Implemented Interfaces:
HasColumns,TableElement
public final class MaterializedView extends AbstractView implements TableElement
Materialized view data element.- Since:
- 2017-06-08
- Author:
- ioann
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHECKSUM_COMMENT_TEMPLATEChecksum comment template.static StringSURROGATE_COUNTSystem field name that contains result of COUNT().-
Fields inherited from class ru.curs.celesta.score.NamedElement
MAX_IDENTIFIER_LENGTH
-
Fields inherited from interface ru.curs.celesta.score.TableElement
YOU_CANNOT_DROP_A_COLUMN_THAT_BELONGS_TO
-
-
Constructor Summary
Constructors Constructor Description MaterializedView(GrainPart grainPart, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(Column<?> column)Adds a column to the table.StringgetChecksum()Column<?>getColumn(String colName)Returns a column by its name or throws an exception with a message that the column is not found.List<String>getColumnRefNames()Map<String,Column<?>>getColumns()Returns a map of columns of the view.StringgetGroupByPartOfScript()StringgetPkConstraintName()Returns PK constraint name.Map<String,Column<?>>getPrimaryKey()Returns unmodified map of primary key columns.TableRefgetRefTable()StringgetSelectPartOfScript()IntegerColumngetSurrogateCount()StringgetTriggerName(TriggerType type)booleanhasPrimeKey()Whether the table has primary key.booleanisGroupByColumn(String alias)voidremoveColumn(Column<?> column)Removes a column from the table.-
Methods inherited from class ru.curs.celesta.score.AbstractView
getAggregateColumns, getColumnIndex, getColumnRef, getSegments, selectScript
-
Methods inherited from class ru.curs.celesta.score.DataGrainElement
delete
-
Methods inherited from class ru.curs.celesta.score.GrainElement
getGrain, getGrainPart
-
Methods inherited from class ru.curs.celesta.score.NamedElement
equals, getCelestaDoc, getName, getQuotedName, getQuotedNameIfNeeded, hashCode, limitName, limitName, setCelestaDoc
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ru.curs.celesta.score.TableElement
getGrain, getName, getQuotedName, getQuotedNameIfNeeded
-
-
-
-
Field Detail
-
SURROGATE_COUNT
public static final String SURROGATE_COUNT
System field name that contains result of COUNT().- See Also:
- Constant Field Values
-
CHECKSUM_COMMENT_TEMPLATE
public static final String CHECKSUM_COMMENT_TEMPLATE
Checksum comment template.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MaterializedView
public MaterializedView(GrainPart grainPart, String name) throws ParseException
- Throws:
ParseException
-
-
Method Detail
-
getSurrogateCount
public IntegerColumn getSurrogateCount()
-
getColumns
public Map<String,Column<?>> getColumns()
Description copied from class:AbstractViewReturns a map of columns of the view.- Specified by:
getColumnsin interfaceHasColumns- Specified by:
getColumnsin interfaceTableElement- Specified by:
getColumnsin classAbstractView
-
getColumn
public Column<?> getColumn(String colName) throws ParseException
Description copied from interface:TableElementReturns a column by its name or throws an exception with a message that the column is not found.- Specified by:
getColumnin interfaceTableElement- Parameters:
colName- column name- Returns:
- Throws:
ParseException- if a column with the specified name is not found in the table
-
addColumn
public void addColumn(Column<?> column) throws ParseException
Description copied from interface:TableElementAdds a column to the table.- Specified by:
addColumnin interfaceTableElement- Parameters:
column- new column- Throws:
ParseException- if the column couldn't be added
-
removeColumn
public void removeColumn(Column<?> column) throws ParseException
Description copied from interface:TableElementRemoves a column from the table.- Specified by:
removeColumnin interfaceTableElement- Parameters:
column- existing column- Throws:
ParseException- if the column couldn't be removed
-
hasPrimeKey
public boolean hasPrimeKey()
Description copied from interface:TableElementWhether the table has primary key.- Specified by:
hasPrimeKeyin interfaceTableElement- Returns:
-
getPkConstraintName
public String getPkConstraintName()
Description copied from interface:TableElementReturns PK constraint name.- Specified by:
getPkConstraintNamein interfaceTableElement- Returns:
-
getPrimaryKey
public Map<String,Column<?>> getPrimaryKey()
Description copied from interface:TableElementReturns unmodified map of primary key columns.- Specified by:
getPrimaryKeyin interfaceTableElement- Returns:
- map of column name -> column
-
getRefTable
public TableRef getRefTable()
-
isGroupByColumn
public boolean isGroupByColumn(String alias)
-
getSelectPartOfScript
public String getSelectPartOfScript()
-
getGroupByPartOfScript
public String getGroupByPartOfScript()
-
getChecksum
public String getChecksum()
-
getTriggerName
public String getTriggerName(TriggerType type)
-
-