Skip to content

Commit

Permalink
MONDRIAN: Hierarchize was not working for parent child dimensions
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 2187]
  • Loading branch information
hhaas committed Jun 22, 2004
1 parent 26d932d commit b058851
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/mondrian/olap/Member.java
Expand Up @@ -139,6 +139,13 @@ public interface Member extends OlapElement, Comparable {
* a ragged hierarchy.
*/
boolean isHidden();

/**
* returns the depth of this member, which is not the level's depth
* in case of parent child dimensions
* @return depth
*/
int getDepth();
}

// End Member.java
8 changes: 8 additions & 0 deletions src/main/mondrian/rolap/RolapMember.java
Expand Up @@ -238,6 +238,14 @@ public boolean isHidden() {
throw rolapLevel.hideMemberCondition.unexpected();
}
}

/**
* @return the level's depth
* @see mondrian.olap.Member#getDepth()
*/
public int getDepth() {
return level.getDepth();
}
}


Expand Down
13 changes: 13 additions & 0 deletions src/main/mondrian/rolap/SqlMemberSource.java
Expand Up @@ -869,10 +869,15 @@ public void getMemberDescendants(RolapMember member, List result,
*/
private static class RolapParentChildMember extends RolapMember {
private final RolapMember dataMember;
private int depth = 0;
public RolapParentChildMember(RolapMember parentMember,
RolapLevel childLevel, Object value, RolapMember dataMember) {
super(parentMember, childLevel, value);
this.dataMember = dataMember;
if (parentMember != null)
depth = parentMember.getDepth() + 1;
else
depth = 0;
}
public boolean isCalculated() {
return true;
Expand All @@ -893,6 +898,14 @@ public Object getPropertyValue(String name) {
return super.getPropertyValue(name);
}
}

/**
* @return the members's depth
* @see mondrian.olap.Member#getDepth()
*/
public int getDepth() {
return depth;
}
}
}

Expand Down

0 comments on commit b058851

Please sign in to comment.