Ejemplo n.º 1
0
        internal CubeMetadataCache(AdomdConnection connection, CubeDef parentCube)
        {
            this.msgDelegate         = new AdomdUtils.GetInvalidatedMessageDelegate(this.GetCubesUpdatedMessage);
            this.connection          = connection;
            this.parentCube          = parentCube;
            this.cacheState          = MetadataCacheState.UpToDate;
            this.cacheDataset        = new DataSet();
            this.cacheDataset.Locale = CultureInfo.InvariantCulture;
            this.restrictions        = new ListDictionary();
            this.restrictions.Add(CubeCollectionInternal.cubeNameRest, parentCube.Name);
            AdomdUtils.AddCubeSourceRestrictionIfApplicable(this.connection, this.restrictions);
            int count = CubeMetadataCache.internalTypeMap.Count;

            this.objectMetadataCaches = new ObjectMetadataCache[count];
            bool flag = AdomdUtils.ShouldAddObjectVisibilityRestriction(this.connection);

            for (int i = 0; i < count; i++)
            {
                ListDictionary destinationRestrictions;
                if (flag || CubeMetadataCache.SchemaRowsetsData[i].HasAdditionalRestrictions)
                {
                    destinationRestrictions = new ListDictionary();
                    AdomdUtils.CopyRestrictions(this.restrictions, destinationRestrictions);
                    if (CubeMetadataCache.SchemaRowsetsData[i].HasAdditionalRestrictions)
                    {
                        CubeMetadataCache.AddSpecificRestrictions(CubeMetadataCache.SchemaRowsetsData[i], destinationRestrictions);
                    }
                    if (flag)
                    {
                        AdomdUtils.AddObjectVisibilityRestrictionIfApplicable(this.connection, CubeMetadataCache.SchemaRowsetsData[i].RequestType, destinationRestrictions);
                    }
                }
                else
                {
                    destinationRestrictions = this.restrictions;
                }
                this.objectMetadataCaches[i] = new ObjectMetadataCache(this, connection, CubeMetadataCache.SchemaRowsetsData[i], destinationRestrictions);
            }
            this.lastCacheValidationTime = parentCube.PopulatedTime;
            this.cubeInfoTable           = new DataTable();
            this.cubeInfoTable.Locale    = CultureInfo.InvariantCulture;
            this.cubeInfoTable           = ((DataRow)((IAdomdBaseObject)parentCube).MetadataData).Table.Clone();
            this.originalTimeColumn      = ((DataRow)((IAdomdBaseObject)parentCube).MetadataData).Table.Columns[CubeDef.lastSchemaUpdateColumn];
            this.currentTimeColumn       = this.cubeInfoTable.Columns[CubeDef.lastSchemaUpdateColumn];
        }
Ejemplo n.º 2
0
        private string GetUniqueNameColumn(InternalObjectType objectType)
        {
            SchemaRowsetCacheData schemaRowsetCacheData = CubeMetadataCache.SchemaRowsetsData[CubeMetadataCache.GetIndexForInternalType(objectType)];

            return(schemaRowsetCacheData.UniqueNameColumnName);
        }
Ejemplo n.º 3
0
 private ObjectMetadataCache GetObjectCache(InternalObjectType objectType)
 {
     return(this.objectMetadataCaches[CubeMetadataCache.GetIndexForInternalType(objectType)]);
 }
Ejemplo n.º 4
0
        private void CreatePrimaryKeys(DataTable table, InternalObjectType objectType)
        {
            SchemaRowsetCacheData schemaRowsetCacheData = CubeMetadataCache.SchemaRowsetsData[CubeMetadataCache.GetIndexForInternalType(objectType)];

            DataColumn[] array = new DataColumn[schemaRowsetCacheData.PrimaryKeyColumns.Length];
            for (int i = 0; i < schemaRowsetCacheData.PrimaryKeyColumns.Length; i++)
            {
                array[i] = table.Columns[schemaRowsetCacheData.PrimaryKeyColumns[i]];
            }
            table.PrimaryKey = array;
        }