[英]Multiple hierarchy in mondrian says Hierarchy not found
我在mondrian模式中遵循Dimension。 蒙德里安在建立聯系上說
mondrian.olap.MondrianException:Mondrian錯誤:內部錯誤:找不到層次結構“ [產品]”
<Dimension name="Product" foreignKey="item_id">
<Hierarchy hasAll="true" primaryKey="item_code" primaryKeyTable="m_item_master">
<Join leftKey="item_code" rightKey="item_code">
<Table name="m_item_master"/> <!--dummy_master--> <!--m_item_master-->
<Table name="m_item_relation"/>
</Join>
<Level name="Department" table="m_item_relation" column="department"/>
<Level name="Class" table="m_item_relation" column="category"/>
<Level name="Item" table="m_item_master" column="item_code" ordinalColumn="item_code" nameColumn="name" uniqueMembers="true" type="Numeric"/>
</Hierarchy>
<Hierarchy name="Base Item" hasAll="false" primaryKey="item_code" primaryKeyTable="m_item_master">
<Join leftKey="item_code" rightKey="item_code">
<Table name="m_item_master"/> <!--dummy_master--> <!--m_item_master-->
<Table name="m_item_relation"/>
</Join>
<Level name="Department" table="m_item_relation" column="department" captionColumn="department"/>
<Level name="Item" table="m_item_master" column="item_code" ordinalColumn="item_code" nameColumn="name" uniqueMembers="true" captionColumn="name" type="Numeric"/>
<Property name="Price" table="m_item_master" column="price" />
</Hierarchy>
</Dimension>
我正在使用Mondrian-4.0.0-SNAPSHOT版本,並嘗試與最新的mondrian 4.2.0.0-204版本相同。
注意:此外,我在mondrian連接創建過程中遇到此錯誤。 因此,它與傳遞給它的任何MDX查詢無關。
好。 這就是我發現的錯誤。 為了澄清起見, Mondrian確實支持多個層次結構 ,但是對於上述架構,我們似乎在關聯角色方面存在其他問題。
<Role name="myrole">
<SchemaGrant access="none">
<CubeGrant cube="Transaction" access="all">
<HierarchyGrant hierarchy="[Product]" access="custom" rollupPolicy="partial">
<MemberGrant member="[Product].[Cottage Foods]" access="all"/>
<MemberGrant member="[Product].[Vegetables]" access="all"/>
....
</HierarchyGrant>
....
</CubeGrant>
</SchemaGrant>
</Role>
在上述角色中,盡管默認層次結構采用mondrian中的維度名稱,但如果您在Dimension中具有多個層次結構,則我們必須在角色中將它們指定為[Dimension.Hierarchy],而不僅是Hierarchy名稱。 在我們的情況下,應如下所示。
<Role name="myrole">
<SchemaGrant access="none">
<CubeGrant cube="Transaction" access="all">
<HierarchyGrant hierarchy="[Product.Product]" access="custom" rollupPolicy="partial">
<MemberGrant member="[Product.Product].[Cottage Foods]" access="all"/>
<MemberGrant member="[Product.Product].[Vegetables]" access="all"/>
....
</HierarchyGrant>
....
</CubeGrant>
</SchemaGrant>
</Role>
這樣解決了上述問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.