Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DsdRetrievalEngine"/> class.
        ///     Initializes a new instance of the <see cref="DataflowRetrievalEngine"/> class.
        /// </summary>
        /// <param name="mappingStoreDb">
        /// The mapping store DB.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="mappingStoreDb"/> is null.
        /// </exception>
        public DsdRetrievalEngine(Database mappingStoreDb)
            : base(mappingStoreDb)
        {
            var sqlQueryBuilder = new ReferencedSqlQueryBuilder(this.MappingStoreDb, null);

            this._attributeGroupQueryInfo    = sqlQueryBuilder.Build(DsdConstant.AttributeAttachmentGroupQueryFormat);
            this._attributeMeasureQueryInfo  = sqlQueryBuilder.Build(DsdConstant.AttributeAttachmentMeasureQueryFormat);
            this._groupQueryInfo             = sqlQueryBuilder.Build(DsdConstant.GroupQueryFormat);
            this._attributeDimensionRefsInfo = sqlQueryBuilder.Build(DsdConstant.AttributeDimensionFormat);
            this._componentQueryInfo         = sqlQueryBuilder.Build(DsdConstant.ComponentQueryFormat);
            this._componentQueryInfo.OrderBy = DsdConstant.ComponentOrderBy;
            this._commandBuilder             = new ItemCommandBuilder(this.MappingStoreDb);

            this._componentAnnotationRetrieverEngine = new IdentifiableAnnotationRetrieverEngine(
                mappingStoreDb,
                new ItemTableInfo(SdmxStructureEnumType.Component)
            {
                ForeignKey = "DSD_ID", PrimaryKey = "COMP_ID", Table = "COMPONENT"
            });

            this._groupAnnotationRetrieverEngine = new IdentifiableAnnotationRetrieverEngine(
                mappingStoreDb,
                new ItemTableInfo(SdmxStructureEnumType.Group)
            {
                ForeignKey = "DSD_ID", PrimaryKey = "GR_ID", Table = "DSD_GROUP"
            });
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataflowRetrievalEngine"/> class.
        /// </summary>
        /// <param name="mappingStoreDb">
        /// The mapping store DB.
        /// </param>
        /// <param name="filter">
        /// The filter. (Optional defaults to <see cref="DataflowFilter.Production"/>
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="mappingStoreDb"/> is null.
        /// </exception>
        public DataflowRetrievalEngine(Database mappingStoreDb, DataflowFilter filter = DataflowFilter.Production)
            : base(mappingStoreDb)
        {
            this._artefactCommandBuilder = new DataflowCommandBuilder(mappingStoreDb, filter);
            var sqlQueryBuilder = new ReferencedSqlQueryBuilder(this.MappingStoreDb, null);

            this._keyFamilyRefQuery          = sqlQueryBuilder.Build(DataflowConstant.KeyFamilyRefQueryFormat);
            this._keyFamilyRefCommandBuilder = new ItemCommandBuilder(this.MappingStoreDb);
            ArtefactSqlBuilder dataflowBuilder;
            ArtefactSqlBuilder latestBuilder;

            switch (filter)
            {
            case DataflowFilter.Any:
                dataflowBuilder = new ArtefactSqlBuilder();
                latestBuilder   = new ArtefactSqlBuilder(null, VersionQueryType.Latest);
                break;

            case DataflowFilter.Production:
                dataflowBuilder = new ArtefactSqlBuilder(null, VersionQueryType.All, DataflowConstant.ProductionWhereLatestClause);
                latestBuilder   = new ArtefactSqlBuilder(null, VersionQueryType.Latest, DataflowConstant.ProductionWhereLatestClause);
                break;

            default:
                throw new ArgumentOutOfRangeException("filter");
            }

            this._sqlQueryInfo       = dataflowBuilder.Build(DataflowConstant.TableInfo);
            this._sqlQueryInfoLatest = latestBuilder.Build(DataflowConstant.TableInfo);
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StructureSetRetrievalEngine"/> class.
        /// </summary>
        /// <param name="mappingStoreDb">
        /// The mapping store DB.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="mappingStoreDb"/> is null.
        /// </exception>
        public StructureSetRetrievalEngine(Database mappingStoreDb)
            : base(mappingStoreDb)
        {
            // add for estat annotation
            _mappingStoreDb = this.MappingStoreDb;

            var sqlQueryBuilder = new ReferencedSqlQueryBuilder(this.MappingStoreDb, null);
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HierarchicalCodeListRetrievealEngine"/> class.
        /// </summary>
        /// <param name="mappingStoreDb">
        /// The mapping store DB.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="mappingStoreDb"/> is null.
        /// </exception>
        public HierarchicalCodeListRetrievealEngine(Database mappingStoreDb)
            : base(mappingStoreDb)
        {
            var sqlQueryBuilder = new ReferencedSqlQueryBuilder(this.MappingStoreDb, null);

            this._hierarchyQueryInfo   = sqlQueryBuilder.Build(HclConstant.HierarchyQueryFormat);
            this._codelistRefQueryInfo = sqlQueryBuilder.Build(HclConstant.CodelistRefQueryFormat);
            this._codeRefQueryInfo     = sqlQueryBuilder.Build(HclConstant.CodeRefQueryFormat);
            this._levelQueryInfo       = sqlQueryBuilder.Build(HclConstant.LevelQueryFormat);
            this._itemCommandBuilder   = new ItemCommandBuilder(this.MappingStoreDb);

            this._hierarchalCodeAnnotationRetrieverEngine = new IdentifiableAnnotationRetrieverEngine(mappingStoreDb, new ItemTableInfo(SdmxStructureEnumType.HierarchicalCode)
            {
                ForeignKey = "H_ID", PrimaryKey = "HCODE_ID", Table = "HCL_CODE"
            });
            this._levelAnnotationRetrieverEngine = new IdentifiableAnnotationRetrieverEngine(mappingStoreDb, new ItemTableInfo(SdmxStructureEnumType.HierarchicalCode)
            {
                ForeignKey = "H_ID", PrimaryKey = "LEVEL_ID", Table = "HLEVEL"
            });
            this._hierarchyAnnotationRetrieverEngine = new IdentifiableAnnotationRetrieverEngine(mappingStoreDb, new ItemTableInfo(SdmxStructureEnumType.HierarchicalCode)
            {
                ForeignKey = "HCL_ID", PrimaryKey = "H_ID", Table = "HIERARCHY"
            });
        }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="mappingStoreDb"></param>
 public ContentConstraintRetrievalEngine(Database mappingStoreDb)
     : base(mappingStoreDb)
 {
     var sqlQueryBuilder = new ReferencedSqlQueryBuilder(this.MappingStoreDb, null);
 }