|Oracle® OLAP Java API Developer's Guide
11g Release 1 (11.1)
|PDF · Mobi · ePub|
This preface describes the features of the Oracle OLAP Java API that are new in Oracle OLAP 11g Release 1 (11.1).
Some aspects of the Oracle OLAP Java API are much the same as in previous releases, such as the ability to create queries with classes in the
oracle.olapi.data.source package and to retrieve the data with classes in the
oracle.olapi.data.cursor package. However, in Oracle OLAP 11g Release 1 (11.1) the metadata model of the API has changed and has many new features. The major new features are presented in the following topics.
The Oracle OLAP Java API now has the ability to create and maintain persistent metadata objects. The Oracle Database stores the metadata objects in the Oracle data dictionary.
To provide this new functionality, the Oracle OLAP Java API substantially revises the metadata model. The new model includes several new packages and has significant changes to some existing packages. For example, the
oracle.olapi.metadata.mdm package has many new classes. It also has many new methods added to existing classes.
An application creates most metadata objects with findOrCreate methods of the owning object. For example, the following code finds the
PRODUCTS_AWJ or creates a standard dimension with that name if it does not already exist. The
mdmDBSchema object is the
MdmDatabaseSchema that owns the dimension.
MdmStandardDimension prodDim = mdmDBSchema.findOrCreateStandardDimension("PRODUCTS_AWJ");
Some classes and methods are deprecated in the new model. For example, all of the classes in the
oracle.olapi.metadata.mtm package are deprecated, and methods of other classes that use the
mtm classes are also deprecated. Some
mtm classes mapped transient
mdm objects to relational database structures, such as columns in tables and views. Other
mtm classes specified how Oracle OLAP performed operations such as aggregation or allocation of the values of custom measures. That functionality is replaced by classes in the
mdm, and the
oracle.olapi.syntax package. With the new classes, an application can create permanent metadata objects, map them to data sources, and specify the operations that provide values for measures.
When an application commits the
Transaction in which it has created top-level objects in the OLAP metadata model, such as instances of classes like
MdmPrimaryDimension, those objects then exist in the Oracle data dictionary. They are available for use by ordinary SQL queries as well as for use by applications that use the Oracle OLAP Java API.
Because the metadata objects exist in the Oracle data dictionary, an Oracle Database DBA can restrict access to certain types of the metadata objects. A client application can set such restrictions by using the JDBC API to send standard SQL
REVOKE commands through the JDBC connection for the user session. See Oracle OLAP User's Guide for more information on object security.
An application can now define, build, and maintain analytic workspaces. This new functionality is provided by classes in the
mdm, and the
oracle.olapi.syntax package. In 10g releases of Oracle Database, that functionality was provided by a separate API, the Oracle OLAP Analytic Workspace Java API, which is entirely deprecated in this release.
After defining a metadata object, an application can export that definition in an XML format. Analytic Workspace Manager refers to such a saved definition as a template. An application can also import the XML definition of a metadata object. The
MdmMetadataProvider class has methods for exporting and importing the XML.
With the classes in the
oracle.olap.syntax package, an application can create Java objects that are based on SQL-like expressions, functions, operators, and conditions. The
SyntaxObject class has
toSyntax methods that an application can use to convert SQL expressions into Java objects or to get the SQL syntax from a Java object.
An application can create an
Expression object by using the
SyntaxObject.fromSyntax method or by using a constructor. For example, the following code creates a
StringExpression using a
fromSyntax method and another
StringExpression using a constructor method. The
mp object is the
MdmMetadataProvider for the session.
StringExpression strExp1 = (StringExpression) SyntaxObject.fromSyntax("'Hello world from syntax.'", mp); StringExpression strExp2 = new StringExpression("Hello world from constructor.");
Another new feature is the ability to have multiple user sessions that share the same JDBC connection to the Oracle Database instance and that share the same cache of metadata objects. This ability is provided by the
UserSession class in the
To support legacy applications, the OLAP Java API provides a means of specifying a metadata reader that can recognize metadata objects that were created by a previous method. The
DataProvider class has a metadata reader mode. By default, the metadata reader recognizes Oracle OLAP 11g metadata. If an application that was created using a previous version of the OLAP Java API connects to an instance of Oracle Database 11g Release 1 (11.1) and creates a
DataProvider, then Oracle OLAP automatically uses the appropriate metadata reader mode.
An application can specify a metadata reader mode with a property of a
Properties object or with a string in the proper XML format. For information on the modes and how to specify one, see the constructor methods of the
DataProvider class in the Oracle OLAP Java API Reference documentation.
An application cannot mix metadata reader modes. The 11g metadata reader does not recognize earlier forms of metadata.