Package tilda.parsing.parts
Class View
- java.lang.Object
-
- tilda.parsing.parts.Base
-
- tilda.parsing.parts.View
-
public class View extends Base
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classView.DepWrapper
-
Field Summary
Fields Modifier and Type Field Description java.lang.String_CountStarDeprecatedjava.util.Map<java.lang.String,Base>_DependenciesViewDistinctOn_DistinctOnjava.util.List<Formula>_Formulasjava.util.regex.Pattern_FormulasRegExjava.util.List<FormulaTemplate>_FormulaTemplatesjava.lang.String[]_ImportFormulasjava.util.List<ViewJoin>_Joinsboolean_OCCjava.util.List<ViewColumn>_PivotColumnsjava.util.List<ViewPivotColumn>_PivotColumnsDeprecatedjava.util.List<ViewPivot>_PivotsViewPivot_PivotSinglePrimaryKey_PKViewRealize_RealizeSubWhereClause_SubQueryjava.lang.String_SubWhereSubWhereX_SubWhereXViewTimeSeries_TimeSeriesjava.util.List<ViewColumn>_ViewColumnsjava.util.regex.Pattern_ViewColumnsRegEx-
Fields inherited from class tilda.parsing.parts.Base
_AppDataClassName, _AppFactoryClassName, _BaseClassName, _Description, _DescriptionX, _EntityClass, _HasUniqueQuery, _JsonDEPRECATED, _Masks, _Mode, _ModeStr, _Name, _OriginalDescription, _OriginalName, _OutputMaps, _PadderColumnNames, _ParentSchema, _Prefix, _Queries, _RealizedObj, _RealizedView, _ReferenceTag, _ReferenceUrl, _ShortAlias_DEPRECATED, _TenantInit, _TildaType, _Validated
-
-
Constructor Summary
Constructors Constructor Description View()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopyAdvancedViewColumnFields(ViewColumn VC, ViewColumn NewVC)Copies field values from VC to NewVC.static ViewColumncreateTZ(ParserSession PS, ViewColumn VC)java.util.Set<View>getAncestorRealizedViews()Returns a set of the views directly referenced by this view that are not realized, but have an ancestor that is, or null if no such views were found.ColumngetColumn(java.lang.String name)java.lang.String[]getColumnNames()Graph<View.DepWrapper>getDependencyGraph(boolean onlyRealizedViews)java.util.Set<View>getFirstAncestorRealizedViews()Returns a set of the first ancestor views referenced by this view that are realized.java.lang.String[]getFirstIdentityColumnNames(boolean naturalIdentitiesFirst)Returns the list of columns that represent the first identity of the object.FormulagetFormula(java.lang.String FormulaName)FormulagetFormula(java.lang.String FormulaName, boolean deep)ObjectLifecyclegetLifecycle()ColumngetProxyColumn(java.lang.String name)java.lang.StringgetRealizedTableName(boolean includeSchemaName)java.lang.StringgetRootViewName()java.util.Set<View>getSubRealizedViewRootNames()Returns a list of the views directly referenced by this view that are realized, or null if no such views were found.ViewColumngetViewColumn(java.lang.String name)ViewJoingetViewjoin(java.lang.String ObjectName, java.lang.String As)java.lang.StringgetViewSubRealizeFullName()The full schema.name of the _R parallel view as per getViewSubRealizeSchemaName() and getViewSubRealizeViewName().java.lang.StringgetViewSubRealizeSchemaName()The schema name for _R parallel views, currently TILTATMP.java.lang.StringgetViewSubRealizeViewName()The name of the _R view, as this view's "[schemaname]_[name]_R"booleanhasAncestorRealizedViews()Checks whether this view has a dependency on realized views, and as such, a parallel _R view should be, or has been, created.booleanisOCC()java.lang.StringtoString()protected static voidupdateTzColDescriptions(View V)Descriptions for TZColumns are a bit more complicated when dealing with views.booleanvalidate(ParserSession PS, Schema ParentSchema)-
Methods inherited from class tilda.parsing.parts.Base
expandColumnNames, expandColumnNames, getAppDataClassName, getAppFactoryClassName, getBaseClassName, getBaseName, getColumnPad, getFullName, getOutputMap, getQuery, getSchema, getShortName, hasMasking, validateMasks, validateOutputMaps, validateQueries
-
-
-
-
Field Detail
-
_ViewColumns
@SerializedName("columns") public java.util.List<ViewColumn> _ViewColumns
-
_Joins
@SerializedName("joins") public java.util.List<ViewJoin> _Joins
-
_SubWhere
@SerializedName("subWhere") public java.lang.String _SubWhere
-
_SubWhereX
@SerializedName("subWhereX") public SubWhereX _SubWhereX
-
_SubQuery
@SerializedName("subQuery") public SubWhereClause _SubQuery
-
_CountStarDeprecated
@SerializedName("countStar") public java.lang.String _CountStarDeprecated
-
_PivotSingle
@SerializedName("pivot") public ViewPivot _PivotSingle
-
_Pivots
@SerializedName("pivots") public java.util.List<ViewPivot> _Pivots
-
_TimeSeries
@SerializedName("timeSeries") public ViewTimeSeries _TimeSeries
-
_DistinctOn
@SerializedName("distinctOn") public ViewDistinctOn _DistinctOn
-
_PivotColumnsDeprecated
@SerializedName("pivotColumns") public java.util.List<ViewPivotColumn> _PivotColumnsDeprecated
-
_Realize
@SerializedName("realize") public ViewRealize _Realize
-
_ImportFormulas
@SerializedName("importFormulas") public java.lang.String[] _ImportFormulas
-
_Formulas
@SerializedName("formulaColumns") public java.util.List<Formula> _Formulas
-
_FormulaTemplates
@SerializedName("formulaTemplates") public java.util.List<FormulaTemplate> _FormulaTemplates
-
_OCC
public transient boolean _OCC
-
_PK
public transient PrimaryKey _PK
-
_ViewColumnsRegEx
public transient java.util.regex.Pattern _ViewColumnsRegEx
-
_FormulasRegEx
public transient java.util.regex.Pattern _FormulasRegEx
-
_Dependencies
public transient java.util.Map<java.lang.String,Base> _Dependencies
-
_PivotColumns
public transient java.util.List<ViewColumn> _PivotColumns
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getViewColumn
public ViewColumn getViewColumn(java.lang.String name)
-
getProxyColumn
public Column getProxyColumn(java.lang.String name)
-
getColumnNames
public java.lang.String[] getColumnNames()
- Specified by:
getColumnNamesin classBase
-
getLifecycle
public ObjectLifecycle getLifecycle()
- Specified by:
getLifecyclein classBase
-
getViewjoin
public ViewJoin getViewjoin(java.lang.String ObjectName, java.lang.String As)
-
getRealizedTableName
public java.lang.String getRealizedTableName(boolean includeSchemaName)
-
getRootViewName
public java.lang.String getRootViewName()
-
validate
public boolean validate(ParserSession PS, Schema ParentSchema)
-
createTZ
public static ViewColumn createTZ(ParserSession PS, ViewColumn VC)
-
updateTzColDescriptions
protected static void updateTzColDescriptions(View V)
Descriptions for TZColumns are a bit more complicated when dealing with views. The whole view needs to be fully constructed before we can update the description to accurately describe which column a TzCol corresponds to. *- Parameters:
V-
-
copyAdvancedViewColumnFields
protected void copyAdvancedViewColumnFields(ViewColumn VC, ViewColumn NewVC)
Copies field values from VC to NewVC. Handles _AggregateStr, _FormulaOnly, _JoinOnly, _Coalesce, _Distinct _OrderBy, _Filter, _Expression, _TypeStr, _Size, _Scale, _Precision.- Parameters:
VC-NewVC-
-
getFormula
public Formula getFormula(java.lang.String FormulaName)
-
getFormula
public Formula getFormula(java.lang.String FormulaName, boolean deep)
-
getDependencyGraph
public Graph<View.DepWrapper> getDependencyGraph(boolean onlyRealizedViews)
-
getSubRealizedViewRootNames
public java.util.Set<View> getSubRealizedViewRootNames()
Returns a list of the views directly referenced by this view that are realized, or null if no such views were found.- Returns:
-
getAncestorRealizedViews
public java.util.Set<View> getAncestorRealizedViews()
Returns a set of the views directly referenced by this view that are not realized, but have an ancestor that is, or null if no such views were found.- Returns:
-
getFirstAncestorRealizedViews
public java.util.Set<View> getFirstAncestorRealizedViews()
Returns a set of the first ancestor views referenced by this view that are realized. if no such views were found.- Returns:
-
hasAncestorRealizedViews
public boolean hasAncestorRealizedViews()
Checks whether this view has a dependency on realized views, and as such, a parallel _R view should be, or has been, created.- Returns:
-
getViewSubRealizeSchemaName
public java.lang.String getViewSubRealizeSchemaName()
The schema name for _R parallel views, currently TILTATMP.- Returns:
-
getViewSubRealizeViewName
public java.lang.String getViewSubRealizeViewName()
The name of the _R view, as this view's "[schemaname]_[name]_R"- Returns:
-
getViewSubRealizeFullName
public java.lang.String getViewSubRealizeFullName()
The full schema.name of the _R parallel view as per getViewSubRealizeSchemaName() and getViewSubRealizeViewName(). Only makes sense if hasAncestorRealizedViews() returns true, otherwise, this _R view wouldn't need to exist.- Returns:
-
getFirstIdentityColumnNames
public java.lang.String[] getFirstIdentityColumnNames(boolean naturalIdentitiesFirst)
Description copied from class:BaseReturns the list of columns that represent the first identity of the object. If a PK is defined, the columns defined for it will be returned. Otherwise, the columns for the first defined unique index will be returned. Null is returned otherwise, that that should never happen because all Objects are required to have at least one identity.
This method should only be called AFTERObject.validate(ParserSession, Schema)has been called first.- Specified by:
getFirstIdentityColumnNamesin classBase- Returns:
-
-