mondrian的父子层级

父子层级

传统的层次有非常严格的级别的集合以及粘合在这些级别上的成员。比如在foodmart demo里的product层次上,“商品名称”这个级别上的任何一个成员都有一个父级别叫做“牌子”。这种结构往往对于构造现实数据模型而言过于严格。
父子层级只有一个一个级别(level--不包括all那个leve)。典型的例子如下:

    <Dimension name="Employees" foreignKey="employee_id">
        <Hierarchy hasAll="true" allMemberName="All Employees" primaryKey="employee_id">
          <Table name="employee"/>
          <Level name="Employee Id" uniqueMembers="true" type="Numeric" column="employee_id" nameColumn="full_name" parentColumn="supervisor_id" nullParentValue="0">
             <Property name="Marital Status" column="marital_status"/>
             <Property name="Position Title" column="position_title"/>
             <Property name="Gender" column="gender"/>
             <Property name="Salary" column="salary"/>
             <Property name="Education Level" column="education_level"/>
             <Property name="Management Role" column="management_role"/>
          </Level>
       </Hierarchy>
    </Dimension>


parentColumn属性指明了其父成员,所以它是指向了其上级的外键。parentColumn是告诉mondrian该层次是“父子层次”的唯一标示
nullParentValue 属性指明了那些成员没有父成员,默认为null,考虑到null值列不会被索引,一般可以考虑用0或者-1代替以提高性能

 

欢迎转载,转载请注明出处

http://dsbjoe.iteye.com/admin/blogs/1072866

 

你可能感兴趣的:(数据结构,ITeye)