Oracle9i OLAP Services Developer's Guide to the Oracle OLAP API Release 1 (9.0.1) Part Number A88756-01 |
|
Making Queries, 5 of 6
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
.
The OLAP API data types and their relationship to each other are shown in the following table.
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
.
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.
To create a Source
object that represents an OLAP API data type, take the following steps:
FundamentalMetadataProvider
by using the getFundamentalMetadataProvider
method on the DataProvider
class.
FundamentalMetadataObject
object that represents the OLAP API data type by using the appropriate method on the FundamentalMetadataProvider
class.
Source
from the objects returned in Step 1 by using the FundamentalMetadataObject.getSource
method.
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.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|