| Oracle9i OLAP Developer's Guide to the OLAP API Release 2 (9.2) Part Number A95297-01 |
|
Discovering the Available Metadata, 6 of 8
Having discovered the list of MdmMeasure and MdmDimension objects, the next step in metadata discovery involves finding out the characteristics of those objects.
A primary characteristic of an MdmMeasure is that it has related MdmDimension objects. The following code gets a List of MdmDimension objects for an MdmMeasure called sales.
List dimsOfSales = mdmSalesAmount.getDimensions();
The getMeasureInfo method in the sample code provided later in this chapter shows one way to iterate through the MdmDimension objects belonging to a given MdmMeasure.
An MdmDimension has related MdmDimensionDefinition and MdmDimensionMemberType objects, which you can obtain by calling its getDefinition and getMemberType methods. If it is an MdmHierarchy, it also has regions, which you can obtain by calling the getRegions method on its MdmUnionDimensionDefinition.
The following is an example of how you can get the level MdmHierarchy objects for a union MdmHierarchy. The following code prints the names of the level MdmHierarchy objects.
MdmUnionDimensionDefinition unionDef = (MdmUnionDimensionDefinition) mdmDimObj.getDefinition(); List hierarchies = unionDef.getRegions(); for (Iterator iterator = hierarchies.iterator(); iterator.hasNext();) { MdmHierarchy hier = (MdmHierarchy) iterator.next(); System.out.println("Hierarchy: " + hier.getName()); }
The getDimInfo method in the sample code provided later in this chapter shows one way to get the following metadata objects for a given MdmDimension:
MdmDimensionMemberTypeMdmAttribute objectsMdmDimensionDefinitionMdmHierarchy, the code obtains its component MdmHierarchy objects. If it is a level MdmHierarchy, the code obtains its component MdmLevel objectsMdmHierarchy, if it is a union MdmHierarchy.Methods are also available for obtaining other MdmDimension characteristics. See the OLAP API Javadoc for descriptions of all the methods on the MDM classes.
|
![]() Copyright © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|