Package tilda.parsing.parts
Class ViewColumn
- java.lang.Object
-
- tilda.parsing.parts.ViewColumn
-
public class ViewColumn extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description AggregateType_Aggregatejava.lang.String_AggregateAttributesjava.lang.String_AggregateStrjava.lang.String_Asjava.lang.String[]_Blockjava.lang.String_Coalescejava.lang.String_Descriptionjava.lang.Boolean_Distinctjava.lang.String[]_Excludejava.lang.String_Expressionboolean_FailedValidationFrameworkColumnType_FCTjava.lang.String_Filterboolean_FormulaOnlyJoinType_Joinboolean_JoinOnlyjava.lang.String_JoinStrjava.lang.String_MaskDefjava.lang.String_Namejava.lang.String_NameInnerjava.lang.String[]_OrderByjava.util.List<OrderBy>_OrderByObjsView_ParentViewjava.lang.String[]_PartitionByjava.util.List<Column>_partitionByObjsjava.lang.String_Postfixjava.lang.Integer_Precisionjava.lang.String_PrefixColumn_ProxyColjava.lang.String_Rangeprotected static java.util.regex.Pattern_RANGEREGEXjava.lang.String_SameAsjava.lang.String_Sameas_DEPRECATEDColumn_SameAsObjView_SameAsViewjava.lang.Integer_Scalejava.lang.Integer_SizeTypeDef_Typejava.lang.String_TypeStrboolean_UseEnumboolean_UseMapper
-
Constructor Summary
Constructors Constructor Description ViewColumn()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanFixSameAs(ParserSession PS)Handles deprecated "sameas" and replaces with "sameAs" if appropriate.java.lang.StringgetAggregateName()java.lang.StringgetFullName()java.lang.StringgetName()java.lang.StringgetShortName()intgetSize()If the ViewColumn defines an expression and type, returns that.ColumnTypegetType()Returns the final type of the view column, which is the expression's type if defined, or else sameAs' type.java.lang.StringgetTzName(boolean sameAs)Returns the name of the associated TZ column for this column.booleanisCollection()booleanisList()booleanisNullable()booleanisSameAsLitteral()booleanisSet()booleanneedsTZ()A view column of type 'DATETIME' (or DATETIME_PLAIN) needs an extra timezone support field if: the underlying column needs one, and the view column is not an aggregate, and does not have an expression unless it's of type datetime, and is a non-framework-generated column.booleanneedsTZBaseTypeNoAggregate()A view column of type 'DATETIME' (or DATETIME_PLAIN) needs an extra timezone support field if: the underlying column needs one, and does not have an expression unless it's of type datetime, and is a non-framework-generated column. This method is different fromneedsTZ()is that it does not take into account aggregations and looks at the underlying type only.static java.lang.StringPrintColumnList(java.util.List<ViewColumn> L)returns a comma-separated string containing the unescaped column short namesjava.lang.StringtoString()booleanvalidate(ParserSession PS, View ParentView)static booleanvalidateRange(ParserSession PS, java.lang.String viewColumnName, java.lang.String range)static ColumnValidateSameAs(ParserSession PS, java.lang.String ColFullName, java.lang.String SameAs, View ParentView)
-
-
-
Field Detail
-
_Name
@SerializedName("name") public java.lang.String _Name
-
_Sameas_DEPRECATED
@SerializedName("sameas") public java.lang.String _Sameas_DEPRECATED
-
_SameAs
@SerializedName("sameAs") public java.lang.String _SameAs
-
_As
@SerializedName("as") public java.lang.String _As
-
_Expression
@SerializedName("expression") public java.lang.String _Expression
-
_TypeStr
@SerializedName("type") public java.lang.String _TypeStr
-
_Precision
@SerializedName("precision") public java.lang.Integer _Precision
-
_Scale
@SerializedName("scale") public java.lang.Integer _Scale
-
_Size
@SerializedName("size") public java.lang.Integer _Size
-
_Prefix
@SerializedName("prefix") public java.lang.String _Prefix
-
_Postfix
@SerializedName("postfix") public java.lang.String _Postfix
-
_Exclude
@SerializedName("exclude") public java.lang.String[] _Exclude
-
_Block
@SerializedName("block") public java.lang.String[] _Block
-
_JoinStr
@SerializedName("joinType") public java.lang.String _JoinStr
-
_FormulaOnly
@SerializedName("formulaOnly") public boolean _FormulaOnly
-
_JoinOnly
@SerializedName("joinOnly") public boolean _JoinOnly
-
_AggregateStr
@SerializedName("aggregate") public java.lang.String _AggregateStr
-
_OrderBy
@SerializedName("orderBy") public java.lang.String[] _OrderBy
-
_PartitionBy
@SerializedName("partitionBy") public java.lang.String[] _PartitionBy
-
_Range
@SerializedName("range") public java.lang.String _Range
-
_Coalesce
@SerializedName("coalesce") public java.lang.String _Coalesce
-
_Distinct
@SerializedName("distinct") public java.lang.Boolean _Distinct
-
_Filter
@SerializedName("filter") public java.lang.String _Filter
-
_UseMapper
@SerializedName("useMapper") public boolean _UseMapper
-
_UseEnum
@SerializedName("useEnum") public boolean _UseEnum
-
_Description
@SerializedName("description") public java.lang.String _Description
-
_ParentView
public transient View _ParentView
-
_SameAsObj
public transient Column _SameAsObj
-
_SameAsView
public transient View _SameAsView
-
_Join
public transient JoinType _Join
-
_Aggregate
public transient AggregateType _Aggregate
-
_AggregateAttributes
public transient java.lang.String _AggregateAttributes
-
_OrderByObjs
public transient java.util.List<OrderBy> _OrderByObjs
-
_partitionByObjs
public transient java.util.List<Column> _partitionByObjs
-
_Type
public transient TypeDef _Type
-
_NameInner
public transient java.lang.String _NameInner
-
_MaskDef
public transient java.lang.String _MaskDef
-
_FailedValidation
public transient boolean _FailedValidation
-
_FCT
public transient FrameworkColumnType _FCT
-
_ProxyCol
public transient Column _ProxyCol
-
_RANGEREGEX
protected static final java.util.regex.Pattern _RANGEREGEX
-
-
Method Detail
-
getFullName
public java.lang.String getFullName()
-
getShortName
public java.lang.String getShortName()
-
getName
public java.lang.String getName()
-
getAggregateName
public java.lang.String getAggregateName()
-
getType
public ColumnType getType()
Returns the final type of the view column, which is the expression's type if defined, or else sameAs' type. Additionally, It takes into account whether an aggregate has been defined and how the type will be modified.- Returns:
-
getSize
public int getSize()
If the ViewColumn defines an expression and type, returns that. Otherwise, it returns the aggregate or original type.- Returns:
-
FixSameAs
public boolean FixSameAs(ParserSession PS)
Handles deprecated "sameas" and replaces with "sameAs" if appropriate.- Parameters:
PS-- Returns:
-
validate
public boolean validate(ParserSession PS, View ParentView)
-
validateRange
public static boolean validateRange(ParserSession PS, java.lang.String viewColumnName, java.lang.String range)
-
ValidateSameAs
public static Column ValidateSameAs(ParserSession PS, java.lang.String ColFullName, java.lang.String SameAs, View ParentView)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isSameAsLitteral
public boolean isSameAsLitteral()
-
PrintColumnList
public static java.lang.String PrintColumnList(java.util.List<ViewColumn> L)
returns a comma-separated string containing the unescaped column short names- Parameters:
L-- Returns:
-
needsTZ
public boolean needsTZ()
A view column of type 'DATETIME' (or DATETIME_PLAIN) needs an extra timezone support field if:- the underlying column needs one,
- and the view column is not an aggregate,
- and does not have an expression unless it's of type datetime,
- and is a non-framework-generated column.
- Returns:
-
needsTZBaseTypeNoAggregate
public boolean needsTZBaseTypeNoAggregate()
A view column of type 'DATETIME' (or DATETIME_PLAIN) needs an extra timezone support field if:- the underlying column needs one,
- and does not have an expression unless it's of type datetime,
- and is a non-framework-generated column.
needsTZ()is that it does not take into account aggregations and looks at the underlying type only.- Returns:
-
isList
public boolean isList()
-
isSet
public boolean isSet()
-
isCollection
public boolean isCollection()
-
isNullable
public boolean isNullable()
-
getTzName
public java.lang.String getTzName(boolean sameAs)
Returns the name of the associated TZ column for this column. This should be called only if "needsTZ" returns true. For row columns, will rename the rowTZ based on the source table/view, or aggregate. For example:- sameAs="SomeTable1.DateTimeColumnWithRowTZ"
- sameAs="SomeTable2.DateTimeColumnWithRowTZ"
- sameAs="SomeTable1.DateTimeColumn1WithRowTZ", aggregate="FIRST", orderBy:["dt1"]
- sameAs="SomeTable1.DateTimeColumn2WithRowTZ", aggregate="FIRST", orderBy:["dt2"]
- The first two come from 2 different tables, so their rowTZ might be different
- The last 2 have a different orderBy, and so the matching rowTZ might again be different.
- Parameters:
sameAs-- Returns:
-
-