EntityContainer 元素 (CSDL)

EntityContainer 元素會定義單一商業智慧資料模型中實體的集合。 在應用程式中,EntityContainer 代表資料模型,其中可能包含多個以關聯性連結資料行的資料表,以及計算、量值和 KPI。

EntityContainer 必須指定資料模型中包含的每個實體類型。 有關這些模型實體的資訊是透過列出 Entity 元素類型的子實體來指定。 如需詳細資訊,請參閱<EntityType 元素 (CSDL)>。

EntityContainer 元素可能具有下列元素:

  • EntitySet 元素

  • AssociationSet 元素

定序和語言等屬性是在 EntityContainer 層級定義的,而非針對個別物件所定義。 不過,模型中的資料行和文字屬性可以具有採用其他語言的標題或翻譯。

適用的屬性

下表描述了可在 EntityContainer 元素上找到的屬性。

屬性名稱

是否必要

值

Name

是

資料模型的名稱。

Caption

否

資料庫或資料模型的描述。

Culture

是

包含要求 LCID 的字串。

CompareOptions

是

模型的語言特有排序和字串比較選項。

CompareOptions 屬性 (Attribute) 會定義套用至資料模型的定序屬性 (Property)。 CompareOptions 所定義的屬性衍生自模型設計階段在 Analysis Services 資料庫中設定之排序次序、區分假名和區分大小寫的設定。 下表描述了當做 CompareOptions 屬性一部分加入的值。

屬性名稱

是否必要

值

IgnoreCase

是

布林值,指出資料模型是否已經啟用此選項。

IgnoreNonSpace

是

布林值,指出資料模型是否已經啟用此選項。

IgnoreKanaType

是

布林值,指出資料模型是否已經啟用排序選項。

IgnoreWidth

是

布林值,指出資料模型是否已經啟用排序選項。

下表顯示 Analysis Services 中的定序選項,以及它們與 .NET 排序選項的比較。

Windows 排序樣式

.Net CompareOptions

二進位 (_BIN) 1

Ordinal

二進位字碼指標 (_BIN2) 1

Ordinal

區分大小寫 (_CS)

IgnoreCase

區分腔調字 (_AS)

IgnoreNonSpace

區分假名 (_KS)

IgnoreKanaType

區分全半形 (_WS)

IgnoreWidth

請注意,系統不支援下列 .NET 設定:

  • IgnoreSymbols

  • OrdinalIgnoreCase

  • StringSort

範例

下列範例代表包含三個資料表的簡單資料模型,而且具有地理位置索引鍵的單一關聯性。 EntityContainer 的 Culture 屬性代表伺服器的語言。

Namespace="SimpleModel">
          <EntityContainer Name="SimpleModel">
            <EntitySet Name="DimCustomer" EntityType="SimpleModel.DimCustomer">
              <bi:EntitySet />
            </EntitySet>
            <EntitySet Name="DimDate" EntityType="SimpleModel.DimDate">
              <bi:EntitySet />
            </EntitySet>
            <EntitySet Name="DimGeography" EntityType="SimpleModel.DimGeography">
              <bi:EntitySet />
            </EntitySet>
            <AssociationSet Name="DimCustomer_DimGeography_GeographyKey" Association="SimpleModelDB.DimCustomer_DimGeography_GeographyKey">
              <End EntitySet="DimCustomer" />
              <End EntitySet="DimGeography" />
              <bi:AssociationSet />
            </AssociationSet>
            <bi:EntityContainer Culture="en-US">
              <bi:CompareOptions IgnoreCase="true" />
            </bi:EntityContainer>
          </EntityContainer>