Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TimeDimension1Column"/> class.
        /// </summary>
        /// <param name="mapping">
        /// The time dimension mapping
        /// </param>
        /// <param name="expression">
        /// The TRANSCODING.EXPRESSION contents
        /// </param>
        /// <param name="databaseType">
        /// The dissemination database vendor from  DB_CONNECTION.DB_TYPE at Mapping Store database. It is used to determine the substring command to use
        /// </param>
        /// <exception cref="TranscodingException">
        /// Occurs when transcoding cannot performed due to incorrect mapping store data
        /// </exception>
        public TimeDimension1Column(MappingEntity mapping, TimeExpressionEntity expression, string databaseType)
            : base(mapping, expression, databaseType)
        {
            this._periodLocalCode = new CodeCollection();
            string yearPeriodColumn = GetColumnName(mapping, expression.YearColumnSysId);
            string yearOnlyStart    = this.CreateSubStringClause(yearPeriodColumn, expression.YearStart + 1, expression.YearLength, ">=");
            string yearOnlyEnd      = this.CreateSubStringClause(yearPeriodColumn, expression.YearStart + 1, expression.YearLength, "<=");

            string whereFormat = this.CreateSubStringClause(yearPeriodColumn, expression.PeriodStart + 1, expression.PeriodLength, "=");

            string yearOnlyWhereFormat = this.CreateSubStringClause(yearPeriodColumn, expression.YearStart + 1, expression.YearLength, "=");

            this._whereBuilder  = new TimeTranscodingWhereBuilder(this.Periodicity, this.Expression, whereFormat, yearOnlyEnd, yearOnlyStart, yearOnlyWhereFormat);
            this._fieldOrdinals = new TimeTranscodingFieldOrdinal(mapping, this.Expression);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TimeDimension2Column"/> class.
        /// </summary>
        /// <param name="mapping">
        /// The time dimension mapping
        /// </param>
        /// <param name="expression">
        /// The TRANSCODING.EXPRESSION contents
        /// </param>
        /// <param name="databaseType">
        /// The dissemination database vendor from  DB_CONNECTION.DB_TYPE at Mapping Store database. It is used to determine the substring command to use
        /// </param>
        /// <exception cref="TranscodingException">
        /// Occurs when transcoding cannot performed due to incorrect mapping store data
        /// </exception>
        public TimeDimension2Column(MappingEntity mapping, TimeExpressionEntity expression, string databaseType)
            : base(mapping, expression, databaseType)
        {
            string yearOnlyWhereFormat;
            string yearOnlyStart;
            string yearOnlyEnd;
            string whereFormat;

            this._periodLocalCode = new CodeCollection();
            string yearColumn   = GetColumnName(mapping, expression.YearColumnSysId);
            string periodColumn = GetColumnName(mapping, expression.PeriodColumnSysId);

            string periodClause = expression.PeriodLength == 0
                                      ? string.Format(FormatProvider, "( {0} = '{1}' )", periodColumn, "{0}")
                                      : this.CreateSubStringClause(periodColumn, expression.PeriodStart + 1, expression.PeriodLength, "=");

            if (expression.YearLength == 0)
            {
                yearOnlyStart       = string.Format(FormatProvider, " ( {0} >= '{1}' )", yearColumn, "{0}");
                yearOnlyEnd         = string.Format(FormatProvider, " ( {0} <= '{1}' )", yearColumn, "{0}");
                yearOnlyWhereFormat = string.Format(FormatProvider, "( {0} = '{1}' )", yearColumn, "{0}");

                // whereFormat = String.Format(FormatProvider,"({0} = '{1}' and {2} )",yearColumn, "{0}",periodClause);
                whereFormat = periodClause;
            }
            else
            {
                yearOnlyStart = this.CreateSubStringClause(yearColumn, expression.YearStart + 1, expression.YearLength, ">=");
                yearOnlyEnd   = this.CreateSubStringClause(yearColumn, expression.YearStart + 1, expression.YearLength, "<=");

                whereFormat         = periodClause;
                yearOnlyWhereFormat = this.CreateSubStringClause(yearColumn, expression.YearStart + 1, expression.YearLength, "=");
            }

            this._whereBuilder  = new TimeTranscodingWhereBuilder(this.Periodicity, this.Expression, whereFormat, yearOnlyEnd, yearOnlyStart, yearOnlyWhereFormat);
            this._fieldOrdinals = new TimeTranscodingFieldOrdinal(mapping, this.Expression);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TimeDimension2Column"/> class. 
        /// </summary>
        /// <param name="mapping">
        /// The time dimension mapping
        /// </param>
        /// <param name="expression">
        /// The TRANSCODING.EXPRESSION contents
        /// </param>
        /// <param name="databaseType">
        /// The dissemination database vendor from  DB_CONNECTION.DB_TYPE at Mapping Store database. It is used to determine the substring command to use
        /// </param>
        /// <exception cref="TranscodingException">
        /// Occurs when transcoding cannot performed due to incorrect mapping store data
        /// </exception>
        public TimeDimension2Column(MappingEntity mapping, TimeExpressionEntity expression, string databaseType)
            : base(mapping, expression, databaseType)
        {
            string yearOnlyWhereFormat;
            string yearOnlyStart;
            string yearOnlyEnd;
            string whereFormat;
            this._periodLocalCode = new CodeCollection();
            string yearColumn = GetColumnName(mapping, expression.YearColumnSysId);
            string periodColumn = GetColumnName(mapping, expression.PeriodColumnSysId);

            string periodClause = expression.PeriodLength == 0
                                      ? string.Format(FormatProvider, "( {0} = '{1}' )", periodColumn, "{0}")
                                      : this.CreateSubStringClause(periodColumn, expression.PeriodStart + 1, expression.PeriodLength, "=");

            if (expression.YearLength == 0)
            {
                yearOnlyStart = string.Format(FormatProvider, " ( {0} >= '{1}' )", yearColumn, "{0}");
                yearOnlyEnd = string.Format(FormatProvider, " ( {0} <= '{1}' )", yearColumn, "{0}");
                yearOnlyWhereFormat = string.Format(FormatProvider, "( {0} = '{1}' )", yearColumn, "{0}");

                // whereFormat = String.Format(FormatProvider,"({0} = '{1}' and {2} )",yearColumn, "{0}",periodClause);
                whereFormat = periodClause;
            }
            else
            {
                yearOnlyStart = this.CreateSubStringClause(yearColumn, expression.YearStart + 1, expression.YearLength, ">=");
                yearOnlyEnd = this.CreateSubStringClause(yearColumn, expression.YearStart + 1, expression.YearLength, "<=");

                whereFormat = periodClause;
                yearOnlyWhereFormat = this.CreateSubStringClause(yearColumn, expression.YearStart + 1, expression.YearLength, "=");
            }

            this._whereBuilder = new TimeTranscodingWhereBuilder(this.Periodicity, this.Expression, whereFormat, yearOnlyEnd, yearOnlyStart, yearOnlyWhereFormat);
            this._fieldOrdinals = new TimeTranscodingFieldOrdinal(mapping, this.Expression);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TimeDimension1Column"/> class. 
        /// </summary>
        /// <param name="mapping">
        /// The time dimension mapping
        /// </param>
        /// <param name="expression">
        /// The TRANSCODING.EXPRESSION contents
        /// </param>
        /// <param name="databaseType">
        /// The dissemination database vendor from  DB_CONNECTION.DB_TYPE at Mapping Store database. It is used to determine the substring command to use
        /// </param>
        /// <exception cref="TranscodingException">
        /// Occurs when transcoding cannot performed due to incorrect mapping store data
        /// </exception>
        public TimeDimension1Column(MappingEntity mapping, TimeExpressionEntity expression, string databaseType)
            : base(mapping, expression, databaseType)
        {
            this._periodLocalCode = new CodeCollection();
            string yearPeriodColumn = GetColumnName(mapping, expression.YearColumnSysId);
            string yearOnlyStart = this.CreateSubStringClause(yearPeriodColumn, expression.YearStart + 1, expression.YearLength, ">=");
            string yearOnlyEnd = this.CreateSubStringClause(yearPeriodColumn, expression.YearStart + 1, expression.YearLength, "<=");

            string whereFormat = this.CreateSubStringClause(yearPeriodColumn, expression.PeriodStart + 1, expression.PeriodLength, "=");

            string yearOnlyWhereFormat = this.CreateSubStringClause(yearPeriodColumn, expression.YearStart + 1, expression.YearLength, "=");

            this._whereBuilder = new TimeTranscodingWhereBuilder(this.Periodicity, this.Expression, whereFormat, yearOnlyEnd, yearOnlyStart, yearOnlyWhereFormat);
            this._fieldOrdinals = new TimeTranscodingFieldOrdinal(mapping, this.Expression);
        }