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
_Aggregate
java.lang.String
_AggregateAttributes
java.lang.String
_AggregateStr
java.lang.String
_As
java.lang.String[]
_Block
java.lang.String
_Coalesce
java.lang.String
_Description
java.lang.Boolean
_Distinct
java.lang.String[]
_Exclude
java.lang.String
_Expression
boolean
_FailedValidation
FrameworkColumnType
_FCT
java.lang.String
_Filter
boolean
_FormulaOnly
JoinType
_Join
boolean
_JoinOnly
java.lang.String
_JoinStr
java.lang.String
_MaskDef
java.lang.String
_Name
java.lang.String
_NameInner
java.lang.String[]
_OrderBy
java.util.List<OrderBy>
_OrderByObjs
View
_ParentView
java.lang.String[]
_PartitionBy
java.util.List<Column>
_partitionByObjs
java.lang.String
_Postfix
java.lang.Integer
_Precision
java.lang.String
_Prefix
Column
_ProxyCol
java.lang.String
_Range
protected static java.util.regex.Pattern
_RANGEREGEX
java.lang.String
_SameAs
java.lang.String
_Sameas_DEPRECATED
Column
_SameAsObj
View
_SameAsView
java.lang.Integer
_Scale
java.lang.Integer
_Size
TypeDef
_Type
java.lang.String
_TypeStr
boolean
_UseEnum
boolean
_UseMapper
-
Constructor Summary
Constructors Constructor Description ViewColumn()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
FixSameAs(ParserSession PS)
Handles deprecated "sameas" and replaces with "sameAs" if appropriate.java.lang.String
getAggregateName()
java.lang.String
getFullName()
java.lang.String
getName()
java.lang.String
getShortName()
int
getSize()
If the ViewColumn defines an expression and type, returns that.ColumnType
getType()
Returns the final type of the view column, which is the expression's type if defined, or else sameAs' type.java.lang.String
getTzName(boolean sameAs)
Returns the name of the associated TZ column for this column.boolean
isCollection()
boolean
isList()
boolean
isNullable()
boolean
isSameAsLitteral()
boolean
isSet()
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.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. This method is different fromneedsTZ()
is that it does not take into account aggregations and looks at the underlying type only.static java.lang.String
PrintColumnList(java.util.List<ViewColumn> L)
returns a comma-separated string containing the unescaped column short namesjava.lang.String
toString()
boolean
validate(ParserSession PS, View ParentView)
static boolean
validateRange(ParserSession PS, java.lang.String viewColumnName, java.lang.String range)
static Column
ValidateSameAs(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:
toString
in 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:
-
-