[Mondrian] mondrianolap4jmember getAncestorMembers

Paul Stoellberger paul.stoellberger at aschauer-edv.at
Thu May 27 10:47:14 EDT 2010


I have implemented in PAT a routine that checks if one member is an  
ancestor of the another member.
For that reason I use Member member.getAncestorMembers() , which works  
perfectly fine on an XMLA connection, since an XmlaOlap4jMember  
implements that method, but the MondrianOlap4jMember does not and  
throws an UnsupportedOperationException instead.

Is there any good reason why this is not implemented? I know I could ? 
do? it myself by browsing through the getParentMember() myself but I  
thought using the getAncestorMembers() is fine as well.

So in MondrianOlap4jMember the implementation would look like:

public List<Member> getAncestorMembers() { final List<Member> list =  
new ArrayList<Member>();
        MondrianOlap4jMember m = getParentMember();
        while (m != null) {
            m = m.getParentMember();
        return list;

I know using the getAncestorMembers() function would be expensive on  
dimensions with a large hierarchy.
Do you think it would be more reasonable to loop through  
getParentMember myself until I find it?

Nevertheless an implementation of getAncestorMembers() would make  
sense from my pov, unless you have a good reason why its not  
implemented yet. If I use olap4j, I don?t want to care if I use xmla  
or Mondrian connections and just use the same set of methods.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100527/2834d7c5/attachment.html 

More information about the Mondrian mailing list