Skip Headers

Oracle9i OLAP Developer's Guide to the OLAP API
Release 2 (9.2)

Part Number A95297-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Discovering the Available Metadata, 6 of 8


Getting the Characteristics of Metadata Objects

Having discovered the list of MdmMeasure and MdmDimension objects, the next step in metadata discovery involves finding out the characteristics of those objects.

Getting the MdmDimension Objects for an MdmMeasure

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.

Getting the Related Objects for an MdmDimension

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:

Methods are also available for obtaining other MdmDimension characteristics. See the OLAP API Javadoc for descriptions of all the methods on the MDM classes.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2000, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback