Oracle9i OLAP Services Developer's Guide to the Oracle OLAP API
Release 1 (9.0.1)

Part Number A88756-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

Making Queries, 5 of 6


Getting and Working with Fundamental Source Objects

What is Type in the OLAP API?

Type in the OLAP API is the set of Source elements from which a Source object obtains the values of its elements. You can retrieve the OLAP API type of a Source using the getType method that the Source class inherits from the DataDescriptor class.

When you create a new Source object by using a method on an existing Source object, typically the type of the new Source object is the base Source. In other words, the elements of the new Source object are obtained from the set of elements of the base Source object.

For example, assume that you have a Source object named customer whose elements are the unique numerical identifier for each customer. The OLAP API type of customer is Integer. Assume, additionally, that you use the select method on customer to create another Source object named customerSelection. The OLAP API type of customerSelection is customer.

What are the OLAP API data types?

The OLAP API data types and their relationship to each other are shown in the following table.

OLAP API Data Type 

Description 

Value 

A Source object with any OLAP API data type. 

    Date 

A Source object whose elements are Java Date objects. 

    Number 

A Source object with any of OLAP API numerical data type. 

        Double 

A Source object whose values have the Java double data type. 

         Float 

A Source object whose values have the Java float data type. 

        Integer 

A Source object whose values have the Java int data type. 

         Short 

A Source object whose values have the Java short data type. 

    String 

A Source object whose elements are Java String objects. 

    Boolean 

A Source object whose values have the Java boolean data type. 

Empty 

A Source object that does not have any elements defined for it. 

Null 

A Source object that has a single element with the value of null.  

Retrieving the OLAP API data type of a Source

You can retrieve the OLAP API data type of a Source using the getDataType method that the Source class inherits from the DataDescriptor class.

Also, because the OLAP API is an object-oriented API, it provides a FundamentalMetadataObject to represent each of the fundamental Java data types and the Java String object. These objects are known as the OLAP API data types. You can create a Source object that represents a FundamentalMetadataObject.

Creating Objects that Represent OLAP API Data Types

You can retrieve the objects that represent the OLAP API data types using methods on the FundamentalMetadataProvider. Each of these methods returns a FundamentalMetadataObject. The OLAP API data types and the methods you use to retrieve them are shown in the following table.

OLAP API Data Type 

Method That Retrieves This Data Type 

Value 

getValueDataType 

    Boolean 

getBooleanDataType 

    Date 

getDateDataType 

    Number 

getNumberDataType 

        Double 

getDoubleDataType 

         Float 

getFloatDataType 

        Integer 

getIntegerDataType 

         Short 

getShortDataType 

    String 

getStringDataType 

Empty 

getEmptyDataType

To retrieve an empty Source, use the DataProvider.getEmptySource method. 

Null 

getVoidDataType

To retrieve a null Source, use the DataProvider.getVoidSource method. 

Steps: Creating a Source that represents an OLAP API data type

To create a Source object that represents an OLAP API data type, take the following steps:

  1. Get the FundamentalMetadataProvider by using the getFundamentalMetadataProvider method on the DataProvider class.

  2. Create the FundamentalMetadataObject object that represents the OLAP API data type by using the appropriate method on the FundamentalMetadataProvider class.

  3. Create a Source from the objects returned in Step 1 by using the FundamentalMetadataObject.getSource method.

Example: Creating a Source for the OLAP API Boolean data type

The code shown below creates a Source object that represents the OLAP API Boolean data type.

FundamentalMetadataObject myFundamentalMetadataProvider =
    myDataProvider.getFundamentalMetadataProvider(); 
FundamentalMetadataObject olapBooleanFundObj =
    myFundamentalMetadataProvider.getBooleanType(); 
Source olapBooleanDataType = olapBooleanFundObj.getSource(); 

Now you can use olapBooleanDataType to check to see if the OLAP API data type of any other Source is Boolean.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, 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