diff --git a/doc/images/spacer.png b/doc/images/spacer.png new file mode 100644 index 0000000..55e77fc Binary files /dev/null and b/doc/images/spacer.png differ diff --git a/doc/olap4j_fs.html b/doc/olap4j_fs.html index bdaad23..c410279 100644 --- a/doc/olap4j_fs.html +++ b/doc/olap4j_fs.html @@ -1,8 +1,9 @@ +
-Authors: Julian Hyde, Barry Klawans
-Version: 0.9.7 (beta)
+
Authors: Julian Hyde, Barry Klawans
+Version: 1.0
Revision: $Id$
-(log)
-Last modified: June 25th, 2009.
olap4j is an open Java API for building OLAP applications.
@@ -291,9 +331,15 @@There are experimental modules in olap4j for scenarios (also +called 'what-if' analysis, or 'writeback') and notifications, +pushed from the server to the client when the data set on the server +changes.
+ +At this point, you may be saying: what about XML/A? XML/A was here first, is an open standard, and is supported by a number of servers. Is olap4j an attempt to @@ -320,7 +366,16 @@
The metamodels of olap4j and XML/A are similar. Both contain +schemas, cubes, dimensions, et cetera. Where possible, olap4j uses the +same terminology for entity and attribute names. This simplifies the +job of creating an XML/A driver for olap4j, and also makes possible an +XML/A -to-olap4j bridge (a server that answers XML/A requests by +querying an underlying olap4j data source).
+ +Where possible, olap4j leverages existing standards. This has several advantages. First, an end-user familiar with the existing standards can come up @@ -375,13 +430,14 @@
olap4j requires JDK 1.5 or higher, in particular because it uses the generics and enum features introduced in JDK 1.5.0.
+olap4j works best against JDK 1.6 or higher, because it makes use of the - -java.sql.Wrapper interface. In earlier Java versions, the same functionality +java.sql.Wrapper +interface. In earlier Java versions, the same functionality is available by casting objects to the built-in OlapWrapper interface.
-JDK 1.4 compatibility will be available on demand, using the +
JDK 1.4 compatibility will be available on demand, using the
Retroweaver utility. This will
consist of a retrowoven JAR file, olap4j-jdk1.4.jar
and
retroweaver's runtime library retroweaver-rt-1.2.4.jar
. (See
@@ -389,54 +445,61 @@
olap4j's JDBC support is consistent with JDBC version 3.0 (which was introduced in JDK 1.4 and is also in JDK 1.5) and also with JDBC version 4.0 (introduced in JDK 1.6).
+There are two compliance levels to which a driver can support olap4j. olap4j -is a rich specification, and it takes a considerable effort to implement it -fully, but applications can still be built on a driver which only implements the -core parts of the specification. The lower level allows a vendor to a subset of -the specification without the significant investment of a fully-compliant + +
There are two compliance levels to which a driver can support olap4j. olap4j +is a rich specification, and it takes a considerable effort to implement it +fully, but applications can still be built on a driver which only implements the +core parts of the specification. The lower level allows a vendor to a subset of +the specification without the significant investment of a fully-compliant driver.
+The compliance levels are as follows:
+org.olap4j
- package, with the exception of the getXxxxs()
methods in
-
- OlapDatabaseMetaData that return result sets, and all classes in the
- org.olap4j.metadata
package. The OLAP server must also
- implement the fundamental features of the MDX language (see below).getXxxxs()
methods, plus
- implements an MDX parser and validator (org.olap4j.mdx.parser
- package).org.olap4j
+ package, with the exception of the getXxxxs()
methods in
+
+ OlapDatabaseMetaData that return result sets, and all classes in the
+ org.olap4j.metadata
package. The OLAP server must also
+ implement the fundamental features of the MDX language (see below).getXxxxs()
methods, plus
+ implements an MDX parser and validator (org.olap4j.mdx.parser
+ package).All olap4j drivers must implement the fundamental features of the MDX -language, but olap4j compliance levels do not imply a particular degree of -support for the MDX language.
+ +All olap4j drivers must implement the fundamental features of the +MDX language, but olap4j compliance levels do not imply a particular +degree of support for the MDX language.
+The fundamental features of MDX are:
+Of course, a provider may implement a larger subset of MDX, and -most do. A provider can describe its MDX compliance level by describing the -additional features it supports (e.g. WITH MEMBER, WITH SET, NON EMPTY, and -HAVING clauses in queries; virtual cubes; and calculated members and sets + +
Of course, a provider may implement a larger subset of MDX, and +most do. A provider can describe its MDX compliance level by describing the +additional features it supports (e.g. WITH MEMBER, WITH SET, NON EMPTY, and +HAVING clauses in queries; virtual cubes; and calculated members and sets defined against cubes) and additional functions and operators implemented.
-We now describe the olap4j API in more detail, by breaking it down into a set of functional areas.
@@ -450,47 +513,65 @@Classes:
+Same functionality as JDBC.
+Here is an example of registering an olap4j driver:
Note that this is the same as you would write for any JDBC driver.
+From JDBC 4.0 (JDK 1.6) onwards, compliant JDBC drivers register
+themselves
+automatically by creating an entry in their JAR file's
+META-INF/services/java.sql.Driver
file.
+Compliant olap4j drivers register themselves in the same way.
Same functionality as JDBC.
+Same functionality as JDBC.
-Extension to DataSource
that returns OlapConnection
+
+
See also: Database.
+ +Extension to DataSource
that returns OlapConnection
objects rather than mere java.sql.Connection
objects.
OlapException + +
OlapException (extends - -java.sql.SQLException) describes an error which occurred while accessing an -OLAP server.
-Since olap4j extends JDBC, it is natural that OlapException should extend
-JDBC's
-
-SQLException. The implementation by an olap4j
-driver of a JDBC method which is declared to throw a SQLException may, if the
-driver chooses, throw instead an OlapException.
-
-OlapException provides some additional information to help an OLAP client
-identify the location of the error. The context
is the Cell
-or Position object where the error occurred. The region
is an
-object representing the textual region in the MDX statement.
Since olap4j extends JDBC, it is natural that OlapException should +extend JDBC's +SQLException. +The implementation by an olap4j driver of a JDBC method which is declared to throw a SQLException may, +if the driver chooses, throw instead an OlapException.
+ +OlapException provides some additional information to help an OLAP
+client identify the location of the error. The context
is
+the Cell or Position object where the error occurred. The region
+is an object representing the textual region in the MDX statement.
Methods:
+Region getRegion()
setRegion(Region region)
Here's a piece of code to connect to Microsoft SQL Server Analysis @@ -536,23 +617,23 @@
In the above examples, a statement was created from a string. As we shall see, a statement can also be created from an MDX parse tree.
@@ -575,152 +656,187 @@If you are using a connection-pooling library, olap4j provides the
-OlapWrapper
-interface with the method method unwrap(Class)
to access the object underneath
+OlapWrapper
+interface with the method method unwrap(Class)
to access the object underneath
the wrapped
-connection. For instance, if you were using DBCP, you could define and use a
+connection. For instance, if you were using DBCP, you could define and use a
pooling olap4j data source as follows:
The OlapStatement,
-PreparedOlapStatement,
-and CellSet
+PreparedOlapStatement,
+and CellSet
interfaces also extend OlapWrapper
, and can be accessed similarly.
If connection pooling is not being used, then the object returned by the
-driver will be an OlapConnection
and will therefore trivially
-implement OlapWrapper
(because the OlapConnection
-interface extends OlapWrapper
). If connection pooling is being
-used, the code will work provided that the implementer of the connection pool
-has ensured that the pooled connection object implements the OlapWrapper
-interface. This is a minor change to the connection pool, and we hope that
+driver will be an OlapConnection
and will therefore trivially
+implement OlapWrapper
(because the OlapConnection
+interface extends OlapWrapper
). If connection pooling is being
+used, the code will work provided that the implementer of the connection pool
+has ensured that the pooled connection object implements the OlapWrapper
+interface. This is a minor change to the connection pool, and we hope that
popular connection pools will utilize this method in the near future.
If you are using JDBC 4.0 (which is part of JDK 1.6 and later), the -java.sql.Connection +java.sql.Connection class implements the -java.sql.Wrapper interface introduced in JDBC 4.0, -so the code can be simplified:
+java.sql.Wrapper +interface introduced in JDBC 4.0, so the code can be simplified: -Note that the OlapWrapper
interface is not needed. This code
+
Note that the OlapWrapper
interface is not needed. This code
will work with any JDBC 4.0-compliant connection pool.
Package name: org.olap4j
--OlapConnection (extends - -java.sql.Connection) is a +OlapConnection +(extends +java.sql.Connection) +is a connection to an OLAP data source.
+Methods:
+NamedList<Catalog> getCatalogs()
Schema getSchema()
void setLocale(Locale locale)
Locale getLocale()
void setRoleName(String roleName)
String getRoleName()
PreparedOlapStatement prepareOlapStatement(String mdx)
MdxParserFactory getParserFactory()
String getCatalog()
// returns the name of the current catalog (inherited from Connection)Catalog getOlapCatalog()
// returns the current catalog objectNamedList<Catalog> getOlapCatalogs()
// returns a list of all catalogsDatabase getOlapDatabase()
// returns the current databaseNamedList<Database> getOlapDatabases()
// returns a list of all databasesString getSchema()
// returns the name of the current schemaSchema getOlapSchema()
// returns the current schema objectNamedList<Schema> getOlapSchema()
// returns a list of all schemasOlapDatabaseMetaData getMetaData()
// returns an object that contains metadata about the databasevoid setLocale(Locale locale)
// sets this connection's localeLocale getLocale()
// returns this connection's localevoid setRoleName(String roleName)
// sets the name of the role in which access-control context this connection will execute queriesString getRoleName()
// returns the name of the role in which access-control context this connection will execute queriesPreparedOlapStatement prepareOlapStatement(String mdx)
// prepares a statementcreateStatement createStatement(String mdx)
// creates a statement (overrides Connection method)List<String> getAvailableRoleNames()
// returns a list of role names available in this connectionScenario createScenario()
// creates a scenariovoid setScenario(Scenario scenario)
// sets the current scenario for this connectionScenario getScenario()
// returns the current scenario for this connectionMdxParserFactory getParserFactory()
// returns a
+factory to create MDX parsers-OlapWrapper -provides the ability to retrieve a delegate instance when the instance in +OlapWrapper +provides the ability to retrieve a delegate instance when the instance in question is in fact a proxy class.
OlapWrapper
duplicates the functionality of the
-java.sql.Wrapper
-interface (introduced in JDBC 4.0), making this functionality available to
-olap4j clients running in a JDBC 3.0 environment. For code which will run only
-on JDBC 4.0 and later, Wrapper
can be used, and OlapWrapper
-can be ignored.
Wrapper
can be used,
+and OlapWrapper
can be ignored.
+
Methods:
+boolean isWrapper()
T unwrap(Class<T>)
boolean isWrapperFor(Class<?> iface)
//
+returns true if this either implements the interface argument or is
+directly or indirectly a wrapper for an object that does<T> T unwrap(Class<T>)
// returns an
+object that implements the given interface-OlapDatabaseMetaData (extends - -java.sql.DatabaseMetaData) provides information about an OLAP database.
-Just as
-
-DatabaseMetaData provides a method to query the each kind of metadata
-element in a relational database (tables, columns, and so forth), returning
-the rows as a
-
-ResultSet, OlapDatabaseMetaData
provides methods for OLAP
-metadata elements (cubes, dimensions, hierarchies, levels, members, measures).
These methods are described in the section "The
-OlapDatabaseMetaData
interface and methods which return schema rowsets".
Just as
+DatabaseMetaData provides a method to query the each kind of
+metadata element in a relational database (tables, columns, and so
+forth), returning the rows as a
+ResultSet,
+OlapDatabaseMetaData
provides methods for OLAP metadata
+elements (cubes, dimensions, hierarchies, levels, members, measures).
These methods are described in the section "The
+OlapDatabaseMetaData
interface and methods which return
+schema rowsets".
OlapStatement (extends -java.sql.Statement) -is an object used to execute a static MDX statement and return the result it + +
OlapStatement +(extends +java.sql.Statement) +is an object used to execute a static MDX statement and return the +result it produces.
-It has methods to execute an MDX query represented both as a string and as a +
It has methods to execute an MDX query represented both as a string and as a parse tree.
Methods:
+CellSet executeOlapQuery(String mdx)
CellSet executeOlapQuery(SelectNode selectNode)
CellSet executeOlapQuery(String mdx)
// executes an MDX statementCellSet executeOlapQuery(SelectNode selectNode)
// executes an MDX statement expressed as a parse treeOlapConnection getConnection()
// returns the current connection (overrides Statement method)addListener(Granularity, CellSetListener)
// adds a listener to be notified of events to CellSets created by this statementPreparedOlapStatement (extends - -java.sql.PreparedStatement) represents a precompiled MDX statement.
+java.sql.PreparedStatement) +represents a precompiled MDX statement. +An MDX statement is precompiled and stored in a PreparedOlapStatement
object. This object can then be used to efficiently execute this statement
multiple times.
The method - -PreparedStatement.getParameterMetaData() returns a description of the +PreparedStatement.getParameterMetaData() +returns a description of the parameters, as in JDBC. The result is an OlapParameterMetaData.
+To set values of parameters, use the setType(int, type)
methods. If a parameter is a member, use the setObject(int, Object)
method; throws an exception if the object is not a member, or is a member of the
@@ -729,55 +845,68 @@
PreparedOlapStatement
.
+
The - -getCube() method returns the cube (or virtual cube) the prepared statement +getCube() +method returns the cube (or virtual cube) the prepared statement relates to.
+Methods:
+CellSet executeQuery()
Cube getCube()
CellSetMetaData getMetaData()
OlapParameterMetaData getParameterMetaData()
CellSet executeQuery()
Cube getCube()
CellSetMetaData getMetaData()
OlapParameterMetaData getParameterMetaData()
OlapParameterMetaData
(extends
-
-java.sql.ParameterMetaData) describes parameters of a
+java.sql.ParameterMetaData)
+describes parameters of a
PreparedOlapStatement
.
Additional methods:
+getName()
getOlapType(int param)
CellSet (extends - -java.sql.ResultSet) is the result of executing an OlapStatement + +
CellSet +(extends +java.sql.ResultSet) +is the result of executing an OlapStatement or PreparedOlapStatement.
It extends ResultSet
, but since most of these methods are concerned with rows
and columns, only a few of the base class's methods are applicable. The following methods
are applicable:
Additional methods to retrieve the axes of the multidimensional result:
+ +Additional methods to retrieve the axes of the multidimensional +result:
+List<CellSetAxis> getAxes()
CellSetAxis getFilterAxis()
Cell getCell(List<Integer> coordinates)
List<CellSetAxis> getAxes()
CellSetAxis getFilterAxis()
Cell getCell(List<Integer> coordinates)
An OlapStatement can have no more than one CellSet open. Closing an -OlapStatement, or preparing or executing a new query, implicitly closes any -previous CellSet.
+An OlapStatement can have no more than one CellSet open. Closing an +OlapStatement, or preparing or executing a new query, implicitly closes +any previous CellSet.
A cell set has the same number of axes as the MDX statement which was -executed to produce it. For example, a typical cell set, resulting from an MDX -query with COLUMNS and ROWS expressions is two-dimensional, and therefore has +executed to produce it. For example, a typical cell set, resulting from an MDX +query with COLUMNS and ROWS expressions is two-dimensional, and therefore has two axes.
Each axis is an ordered collection of members or tuples. Each member or tuple on an axis is called a Position.
The positions on the cell set axis can be accessed sequentially or
-random-access. Use the List<Position> getPositions()
method to
-return a list for random access, or the Iterator<Position> iterate()
+random-access. Use the List<Position> getPositions()
method to
+return a list for random access, or the Iterator<Position> iterate()
method to obtain an iterator for sequential access.
Methods:
+Axis getOrdinal()
CellSet getCellSet()
Methods:
+Axis getAxis()
List<Hierarchy> getHierarchies()
Position is a position on a CellSetAxis.
-An axis has a particular dimensionality, that is, a set of one or more -dimensions which will appear on that axis, and every position on that axis will +
An axis has a particular dimensionality, that is, a set of one or more +dimensions which will appear on that axis, and every position on that axis will have a member of each of those dimensions. For example, in the MDX query
the COLUMNS
axis has dimensionality {[Measures]
} and the
-ROWS
-axis has dimensionality {[Gender]
, [Product]
}. In the result
+ROWS
+axis has dimensionality {[Gender]
, [Product]
}. In the result
of this query,
---
+- -Gender -Product -Unit Sales -Store Sales -- -All Gender -Food -191,940 -409,035.59 -- -All Gender -Drink -24,597 -48,836.21 -- -F -Food -94,814 -203,094.17 -- -F -Drink -12,202 -24,457.37 -- -M -Food -97,126 -205,941.42 -- -M -Drink -12,395 -24,378.84 -+
+ +Gender +Product +Unit Sales +Store Sales ++ +All Gender +Food +191,940 +409,035.59 ++ +All Gender +Drink +24,597 +48,836.21 ++ +F +Food +94,814 +203,094.17 ++ +F +Drink +12,202 +24,457.37 ++ +M +Food +97,126 +205,941.42 ++ +M +Drink +12,395 +24,378.84 +
each of the 5 positions on the ROWS
axis has two members,
-consistent with its dimensionality of 2. The COLUMNS
axis has two
+
each of the 5 positions on the ROWS
axis has two members,
+consistent with its dimensionality of 2. The COLUMNS
axis has two
positions, each with one member.
Methods:
+List<Member> getMembers()
int getOrdinal()
Methods:
+CellSet getCellSet()
int getOrdinal()
List<Integer> getCoordinateList()
Object getPropertyValue(Property)
boolean isError()
boolean isNull()
boolean isEmpty()
double getDoubleValue()
String getErrorText()
Object getValue()
String getFormattedValue()
CellSet getCellSet()
int getOrdinal()
List<Integer> getCoordinateList()
Object getPropertyValue(Property)
boolean isError()
boolean isNull()
boolean isEmpty()
double getDoubleValue()
String getErrorText()
Object getValue()
String getFormattedValue()
CellSetMetaData
-(extends
-
+ CellSetMetaData
+(extends
java.sql.ResultSetMetaData) describes a
CellSet. Methods: The MDX query model represents a parsed MDX statement. An MDX query model can be created in three ways: An MDX query model can be converted into a statement. For example, Package name: org.olap4j.mdx Parse tree classes: Other classes:
ParseTreeWriter is used in conjunction with the
-ParseTreeNode.unparse(ParseTreeWriter) method to convert a parse tree into
+ParseTreeNode.unparse(ParseTreeWriter)
NamedList<Property> getCellProperties()
Cube getCube()
NamedList<CellSetAxisMetaData> getAxesMetaData()
CellSetAxisMetaData getSlicerAxisMetaData()
CellSetAxisMetaData getSlicerAxisMetaData()
2.4. MDX query model
@@ -943,7 +1079,9 @@ 2.4. MDX query model
+
2.4. MDX query model
- import org.olap4j.mdx.*;
-
- // Create a query model.
- OlapConnection connection;
- SelectNode query = new SelectNode();
- query.setFrom(
- new IdentifierNode(
- new
- IdentifierNode.NameSegment("Sales")));
- query.getAxisList().add(
- new AxisNode(
- null,
- false,
- Axis.ROWS,
- new ArrayList<IdentifierNode>(),
- new CallNode(
- null,
- "{}",
-
- Syntax.Braces,
- new
- IdentifierNode(
-
- new IdentifierNode.NameSegment("Measures"),
-
- new IdentifierNode.NameSegment("Unit Sales")))));
-
- // Create a statement based upon the query model.
- OlapStatement stmt;
- try {
- stmt = connection.createStatement();
- } catch (OlapException e) {
- System.out.println("Validation failed: " + e);
- return;
- }
-
- // Execute the statement.
- CellSet cset;
- try {
- cset = stmt.executeOlapQuery(query);
- } catch (OlapException e) {
- System.out.println("Execution failed: " + e);
+ import org.olap.*;
+ import org.olap4j.mdx.*;
+
+ // Create a query model.
+ OlapConnection connection;
+ SelectNode query = new SelectNode();
+ query.setFrom(
+ new IdentifierNode(
+ new
+ IdentifierNode.NameSegment("Sales")));
+ query.getAxisList().add(
+ new AxisNode(
+ null,
+ false,
+ Axis.ROWS,
+ new ArrayList<IdentifierNode>(),
+ new CallNode(
+ null,
+ "{}",
+
+ Syntax.Braces,
+ new
+ IdentifierNode(
+
+ new IdentifierNode.NameSegment("Measures"),
+
+ new IdentifierNode.NameSegment("Unit Sales")))));
+
+ // Create a statement based upon the query model.
+ OlapStatement stmt;
+ try {
+ stmt = connection.createStatement();
+ } catch (OlapException e) {
+ System.out.println("Validation failed: " + e);
+ return;
+ }
+
+ // Execute the statement.
+ CellSet cset;
+ try {
+ cset = stmt.executeOlapQuery(query);
+ } catch (OlapException e) {
+ System.out.println("Execution failed: " + e);
}
SELECT
statement, including FROM
and
- WHERE
- clauses if present.Sales
or
- [Measures].[Unit Sales]
.123
or "Hello, world!"
.WITH MEMBER
clause defining a calculated member.WITH SET
clause defining a calculated set.SELECT
statement, including FROM
and
+ WHERE
+ clauses if present.Sales
or
+ [Measures].[Unit Sales]
.123
or "Hello, world!"
.WITH MEMBER
clause defining a calculated member.WITH SET
clause defining a calculated set.
-
2.4.1 The ParseTreeWriter class
+
Package name: org.olap4j.mdx.parser
Provides an MDX parser and validator.
-Parser and validator are both allocated via a parser factory, which is +
Parser and validator are both allocated via a parser factory, which is obtained from a connection:
Parser and validator are not thread-safe (they cannot be used by more than
+ OlapConnection connection;
+ MdxParserFactory parserFactory =
+ connection.getParserFactory();
+ MdxParser parser =
+ parserFactory.createMdxParser(connection);
+ SelectNode select =
+ parser.parseSelect("SELECT FROM [Sales]");
+ MdxValidator validator =
+ parserFactory.createMdxValidator(connection);
+ select = validator.validate(select);
+
+
Parser and validator are not thread-safe (they cannot be used by more than one thread simultaneously) but they can be re-used for multiple statements.
-One of the chief purposes of validation is to assign a type to every +
One of the chief purposes of validation is to assign a type to every
expression within the parse tree. Before validation, any node's
-ParseTreeNode.getType() method may throw an exception, but after validation
-the getType()
method will return a type. Nodes which are not
+ParseTreeNode.getType() method may throw an exception, but after validation
+the getType()
method will return a type. Nodes which are not
expressions do not have types, and will always return null
.
Classes:
Here are some examples:
-Expression | -Type | -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 + 2 |
- Integer | -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Store] |
- Dimension | -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Store].[State] |
- Level<dimension=[Store], hierarchy=[Store]> | -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Store].[USA].[CA] |
- Member<dimension=[Store], hierarchy=[Store], level=[Store].[State],
+
2.6. MDX type modelevaluated at runtime.Type is the base class for all types. Scalar types: +
Order(Gender.MEMBERS, Measures.[Unit Sales],
+ ASC) is a symbol. Symbol types are rarely used except if you are
+ manipulating a parse tree.
Metadata types: +
A metadata type may be constrained to a particular part of the schema. For @@ -1185,54 +1330,60 @@ 2.6. MDX type modelmust evaluate to one of the levels of the[Time] hierarchy, that
is, one of the values [Time].[Year] , [Time].[Quarter] ,
or [Time].[Month] .
+
Composite types: +
2.7. MetadataPackage name: org.olap4j.metadata Metadata are the objects which describe the structure of an OLAP schema: cubes, dimensions, members, properties and so forth. +olap4j exposes metadata in two very different ways: +
2.7.1. Access control-A user's view of metadata may be subject to access control. The precise rules -for access control depend on the provider, and this specification does not say -what those rules should be. But this specification requires that the API methods + A user's view of metadata may be subject to access control. The precise rules +for access control depend on the provider, and this specification does not say +what those rules should be. But this specification requires that the API methods must behave consistently with the server's access control policy. For example, in mondrian, users belong to roles, and roles may be granted or
-denied access to cubes, hierarchies, or members within hierarchies. Suppose that
+denied access to cubes, hierarchies, or members within hierarchies. Suppose that
user Fred belongs to the "Sales Manager" role, which does not have access to the
In olap4j, you can set a connection's role at connect time using the @@ -1246,2186 +1397,2163 @@ 2.7.2. Metadata objectsThe following diagram shows the metadata objects in an olap4j schema. ![]() In the diagram, each arrow represents a collection of objects in a +parent object; for example, a database is a collection of catalogs, +each catalog is a collection of schemas, each schema is a collection of +cubes, and so forth. Each object has a +corresponding class in the org.olap4j.metadata +package. -In the diagram, each arrow represents a collection of objects in a parent -object; for example, a database is a collection of catalogs, each catalog is a -collection of schemas, each schema is a collection of cubes, and so forth. With -the exception of Database, each object has a corresponding class in the org.olap4j.metadata -package; Database is represented by a combination of the -OlapConnection -class (specifically the - -getCatalogs() method) and by - -OlapDatabaseMetaData (which describes the general capabilities of an OLAP -server). Most metadata objects extend the
MetadataElement interface, which gives them When the API returns a list of metadata elements whose names must be unique + When the API returns a list of metadata elements whose names must be unique (for example, the list of dimensions in a cube), the return type is the -NamedList +NamedList extension to - + java.util.List. -Providers are at liberty to implement metadata objects using a cache, and -therefore over the course of time, different java objects may represent the same + Providers are at liberty to implement metadata objects using a cache, and
+therefore over the course of time, different java objects may represent the same
underlying metadata object. Always use
-
-equals(), not the 2.7.2.1. The MetadataElement interface+A -MetadataElement is an element which describes the structure of an OLAP +MetadataElement is an element which describes the structure of an OLAP schema. -Subtypes are Cube, Dimension, Hierarchy, Level, Member, Property. + + Subtypes are Cube, Dimension, Hierarchy, Level, Member, Property. MetadataElement provides name and unique-name properties (not localized), and localized caption and -description (see - Internationalization). +description (see Internationalization). + +
2.7.2.2. The Database interface+ +A Database +is the highest level element in the hierarchy of metadata objects. A +database contains one or more catalogs. + +Some OLAP servers may only have one database. Mondrian is one such +OLAP server. + +To obtain the collection of databases in the current server, call the
+ Methods: +
2.7.2.2. The Catalog interface-A Catalog -is the highest level element in the hierarchy of metadata objects. A catalog -contains one or more schemas. + +2.7.2.3. The Catalog interface+ +A Catalog +is the highest level element in the hierarchy of metadata objects. A +catalog contains one or more schemas. Some OLAP servers may only have one catalog. Mondrian is one such OLAP -server; its sole catalog is always called "LOCALDB". +server; its sole catalog is always called "LOCALDB". -To obtain the collection of catalogs in the current server, call the To obtain the collection of catalogs in the current server, call the
+ Methods:
2.7.2.3. The Schema interface+2.7.2.4. The Schema interfaceA Schema is -a collection of database objects that contain structural information, or +a collection of database objects that contain structural information, or metadata, about a database. It belongs to a catalog and contains a number of cubes and shared dimensions. +
2.7.2.4. The Cube interface+2.7.2.5. The Cube interfaceA Cube is the central metadata object for representing multidimensional data. It belongs to a schema, and is described by a list of dimensions and a list -of measures. It may also have a collection of named sets, each defined by a +of measures. It may also have a collection of named sets, each defined by a formula.
2.7.2.5. The Dimension interface+2.7.2.6. The Dimension interfaceA Dimension (extends -MetadataElement) is an organized hierarchy of categories, known as levels, +MetadataElement) is an organized hierarchy of categories, known as levels, that describes data in a cube. -Dimensions typically describe a similar set of members upon which the user + Dimensions typically describe a similar set of members upon which the user wants to base an analysis. -A dimension must have at least one hierarchy, and may have more than once, + A dimension must have at least one hierarchy, and may have more than once, but most have exactly one hierarchy.
2.7.2.6. The Hierarchy interface-A Hierarchy + + 2.7.2.7. The Hierarchy interface+ +A Hierarchy (extends -MetadataElement) is an organization of the set of members in a dimension and +MetadataElement) is an organization of the set of members in a dimension and their positions relative to one another. -A hierarchy is a collection of levels, each of which is a category of similar + A hierarchy is a collection of levels, each of which is a category of similar members.
2.7.2.7. The Level interface-A Level + + 2.7.2.8. The Level interface+ +A Level (extends -MetadataElement) is a group of members in a hierarchy, all with the same +MetadataElement) is a group of members in a hierarchy, all with the same attributes and at the same depth in the hierarchy.
2.7.2.8. The Member interface-A Member + + 2.7.2.9. The Member interface+ +A Member (extends MetadataElement) is a data value in an OLAP dimension. +
2.7.2.9. The Measure interface+2.7.2.10. The Measure interfaceA Measure (extends -Member) is a -data value of primary interest to the user browsing the cube. It provides the +Member) is a +data value of primary interest to the user browsing the cube. It provides the value of each cell, and is usually numeric. -Every measure is a member of a special dimension called "Measures". +Every measure is a member of a special dimension called "Measures".
2.7.2.10. The Property interface-Property + 2.7.2.11. The Property interface+ +Property (extends MetadataElement) is the definition of a property of a member or a cell.
- Member member;
+
- Object o = - member.getPropertyValue( + Member member; + Object o = + member.getPropertyValue( Property.StandardMemberProperty.CATALOG_NAME); Members: +
2.7.2.11. The NamedSet interface-A NamedSet + + 2.7.2.12. The NamedSet interface+ +A NamedSet (extends -MetadataElement) describes a set whose value is determined by an MDX +MetadataElement) describes a set whose value is determined by an MDX expression. It belongs to a cube.
2.7.2.12. The Datatype enum+2.7.2.13. The Datatype enumThe -Datatype enum describes the type of property and measure values. Because -olap4j drivers need to interoperate with OLE DB for OLAP and XMLA systems, -Datatype values have the same ordinals as in the OLE DB specification, and we -show here the -name and description of the corresponding type in the OLE DB specification. The table shows +Datatype enum describes the type of property and measure values. Because +olap4j drivers need to interoperate with OLE DB for OLAP and XMLA systems, +Datatype values have the same ordinals as in the OLE DB specification, and we +show here the +name and description of the corresponding type in the OLE DB specification. The table shows the analogous Java type, if there is one. -
2.7.3. -The OlapDatabaseMetaData -interface, and methods which return schema rowsets+2.7.3. The +OlapDatabaseMetaData interface, and methods which return schema rowsets+OlapDatabaseMetaData (extends - -java.sql.DatabaseMetaData) contains methods which return schema result sets. -Schema result sets are specified as in [XML for Analysis -specification]. Here is a table of the XML/A methods and the corresponding -olap4j method and element type. - -
The rows returned in the result set returned from the metadata -methods are structured according to the result set column layouts detailed in this -section. - -All columns noted in the following result sets are required, and -they must be returned in the order shown. However, additional columns (which -should be ignored by clients not expecting them) can be added at the end, and -some columns can contain null data for info that does not apply. - -The following sections describe the columns in each rowset. Each -section includes a table that provides the following information for each -column. - -
2.7.3.1. getDatasources-Specified by the The returned result set contains the following columns. - -
2.7.3.2. getDatabaseProperties- -Returns -information about the standard and provider-specific properties supported by an -olap4j provider. Properties that are not supported by a provider are -not listed in the return result set. -Specified by the The returned result set contains the following columns. - -
2.7.3.3 getLiterals-Retrieves a list of information on supported literals, including data types -and values. -Specified by the The returned result set contains the following columns. - -
2.7.3.4. getCubes- -Describes the structure of cubes within a database. -Specified by the The returned result set contains the following columns. - -
The rowset is sorted on CATALOG_NAME, SCHEMA_NAME, CUBE_NAME. - -2.7.3.5. getDimensions- -Retrieves a result set describing the shared and private dimensions within a database. -Specified by the The returned result set contains the following columns. - -
The result set is sorted on CATALOG_NAME, - SCHEMA_NAME, CUBE_NAME, DIMENSION_NAME. - -2.7.3.6. getFunctions+Schema result sets are specified as in [XML for Analysis +specification]. Here is a table of the XML/A methods and the +corresponding olap4j method and element type. -Retrieves a result set describing the functions available to client - applications connected to the database. -Specified by the The returned result set contains the following columns. +
The rowset is sorted on ORIGIN, INTERFACE_NAME, - FUNCTION_NAME. - -2.7.3.7. getHierarchies-Retrieves a result set describing each hierarchy within a particular -dimension. -Specified by the The returned result set contains the following columns. - -
The rows returned in the result set returned from the metadata +methods are structured according to the result set column layouts +detailed in this +section. + +All columns noted in the following result sets are required, and +they must be returned in the order shown. However, additional columns +(which +should be ignored by clients not expecting them) can be added at the +end, and +some columns can contain null data for info that does not apply. + +The following sections describe the columns in each rowset. Each +section includes a table that provides the following information for +each +column. + +
2.7.3.1. getDatabases+ +Specified by the Note that we use the name 'database' rather than 'data source' +because 'data source' has a well-established and entirely different +meaning (see interface +javax.sql.DataSource) in the JDBC specification. + +The returned result set contains the following columns. + +
2.7.3.2. getDatabaseProperties+ +Returns +information about the standard and provider-specific properties +supported by an +olap4j provider. Properties that are not supported by a provider are +not listed in the return result set. + +Specified by the The returned result set contains the following columns. + +
2.7.3.3 getLiterals+ +Retrieves a list of information on supported literals, including +data types +and values. + +Specified by the The returned result set contains the following columns. + +
2.7.3.4. getCubes+ +Describes the structure of cubes within a database. + +Specified by the The returned result set contains the following columns. + +
The rowset is sorted on CATALOG_NAME, SCHEMA_NAME, CUBE_NAME. + +2.7.3.5. getDimensions+ +Retrieves a result set describing the shared and private dimensions +within a database. + +Specified by the The returned result set contains the following columns. + +
The result set is sorted on CATALOG_NAME, SCHEMA_NAME, +CUBE_NAME, DIMENSION_NAME. + +2.7.3.6. getFunctions+ +Retrieves a result set describing the functions available to client +applications connected to the database. + +Specified by the The returned result set contains the following columns. + +
The rowset is sorted on ORIGIN, INTERFACE_NAME, FUNCTION_NAME. + +2.7.3.7. getHierarchies+ +Retrieves a result set describing each hierarchy within a particular +dimension. + +Specified by the The returned result set contains the following columns. + +
The rowset is sorted on CATALOG_NAME, - SCHEMA_NAME, CUBE_NAME, DIMENSION_UNIQUE_NAME, - HIERARCHY_NAME. +The rowset is sorted on CATALOG_NAME, SCHEMA_NAME, CUBE_NAME, +DIMENSION_UNIQUE_NAME, HIERARCHY_NAME. 2.7.3.8. getLevels-Retrieves a result set describing each level within a particular hierarchy. -Specified by the Retrieves a result set describing each level within a particular +hierarchy. + +Specified by the The returned result set contains the following columns. -
The rowset is sorted on CATALOG_NAME, SCHEMA_NAME, CUBE_NAME, +DIMENSION_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, LEVEL_NUMBER. + +2.7.3.9. getMeasures+ +Retrieves a result set describing each measure within a cube. + +Specified by the The returned result set contains the following columns. + +
2.7.3.9. getMeasures-Retrieves a result set describing each measure within a cube. -Specified by the The returned result set contains the following columns. -
The rowset is sorted on CATALOG_NAME, - SCHEMA_NAME, CUBE_NAME, MEASURE_NAME. +The rowset is sorted on CATALOG_NAME, SCHEMA_NAME, CUBE_NAME, +MEASURE_NAME. 2.7.3.10. getMembers+Retrieves a result set describing the members within a database. -Specified by the Specified by the The returned result set contains the following columns. -
The rowset is sorted on CATALOG_NAME, - SCHEMA_NAME, CUBE_NAME, DIMENSION_UNIQUE_NAME, - HIERARCHY_UNIQUE_NAME, LEVEL_UNIQUE_NAME, - LEVEL_NUMBER, MEMBER_ORDINAL. +
The rowset is sorted on CATALOG_NAME, SCHEMA_NAME, CUBE_NAME, +DIMENSION_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, LEVEL_UNIQUE_NAME, + LEVEL_NUMBER, MEMBER_ORDINAL. 2.7.3.11. getPropertiesRetrieves a list of descriptions of member and cell Properties. -Specified by the Specified by the The returned result set contains the following columns. -
This schema rowset is not sorted. 2.7.3.12. getSets-Retrieves a result set describing any sets that are currently defined in a + + Retrieves a result set describing any sets that are currently +defined in a database, including session-scoped sets. +Specified by the The returned result set contains the following columns. -
The rowset is sorted on CATALOG_NAME, - SCHEMA_NAME, CUBE_NAME. +The rowset is sorted on CATALOG_NAME, SCHEMA_NAME, CUBE_NAME. 2.7.4. Other methods-
2.8. Transform-A transform is an operation which maps a query model to a new query model. It -is usually triggered by a gesture within the user-interface. For example, -clicking on the Unit Sales column transforms the query +NOTE: As of olap4j 1.0, this package is experimental and is subject to change in future releases. -
+ A transform is an operation which maps a query model to a new query +model. It +is usually triggered by a gesture within the user-interface. For +example, +clicking on the Unit Sales column transforms the query - SELECT {[Measures].[Store Sales], [Measures].[Unit Sales]} ON - COLUMNS,- {[Product].Members} ON ROWS - FROM [Sales] + SELECT {[Measures].[Store Sales], [Measures].[Unit
+Sales]} ON COLUMNS,
+ {[Product].Members} ON ROWS +FROM [Sales] into one with sorting: -
- SELECT {[Measures].[Store Sales], [Measures].[Unit Sales]} ON
- COLUMNS, - Order({[Product].Members}, [Measures].[Unit Sales], ASC) ON ROWS - FROM [Sales] + SELECT {[Measures].[Store Sales], [Measures].[Unit
+Sales]} ON COLUMNS,
-+ Order({[Product].Members}, [Measures].[Unit Sales], ASC) ON ROWS +FROM [Sales] Transformations can only modify a query within a cube - it cannot be used to -change the cube that the query is against or to join two cubes. Similarly, the -transform package only supports modifying a MDX query model. For example, a -"drill" transform can not be used to produce a SQL query that returns data + Transformations can only modify a query within a cube - it cannot be +used to +change the cube that the query is against or to join two cubes. +Similarly, the +transform package only supports modifying a MDX query model. For +example, a +"drill" transform can not be used to produce a SQL query that returns +data outside of the cube. Package name: org.olap4j.transform Classes: (incomplete) +
2.8. Transform2.8.1. Query Model Details+This section should probably be moved into Section 2.4. The MDX query language uses a data model based on cubes, dimensions, tuples @@ -3447,6 +3576,7 @@ 2.8.1. Query Model Detailsdimension. A set is an ordered collection of tuples. An MDX query selects zero or more axes using a data slicer. (The axes loosely correspond to the "SELECT" clause in a SQL query, and the slicer to the "WHERE".) +2.8.2. Navigation Actions@@ -3454,6 +3584,7 @@2.8.2. Navigation ActionsRestructuring, Drilling, Scoping.2.8.2.1. Slicing Navigations+
2.8.2.2. Restructuring Navigations2.8.2.3. Drilling Navigations+Navigations that allow a user to move through the levels in a hierarchy. All drill navigations operate on a single Axis. -
2.8.2.4. Scoping NavigationsNavigations that allow a user to expand/collapse sections of a result set. All scoping navigations operate on single Axis. -
2.8.2.5. Supporting Actions+Axis Operations
Open Issuesbased analysis is so common, and so frequently done wrong. ie if the Axis is using a time based dimension you can use "setCompareToPreviousTimePeriod()" instead of having to add the previous time period as a member and calculate - the change. + the change.2.9. Layout-The layout package provides data models for graphical OLAP applications. In + NOTE: As of olap4j 1.0, this package +is experimental and is subject to change in future releases. + +The layout package provides data models for graphical OLAP +applications. In particular, the GridModel class provides, for OLAP data, what Swing's - -TableModel provides for SQL data. +TableModel +provides for SQL data.Package name: org.olap4j.layout Classes: TBD + +2.10. Scenarios+ +NOTE: As of olap4j 1.0, this +functionality is experimental and is subject to change in future releases. + +Scenarios allow an application to change values of cells. When the +value of a cell changes, values of related cells also change (parent +cells, child and descendant cells, and calculated cells). + +Scenarios can therefore be used to perform 'what-if' analysis, +useful in budgeting or forecasting applications. This functionality is +commonly called 'write-back' (or sometimes 'writeback' or +'writethrough'; see for instance +the wikipedia +article "Comparison of OLAP Servers"), but we avoid that term because this +specification does not stipulate that a provider implements scenarios by writing +the changed values to disk. + +Each scenario has a different set of modifications. There is a base +scenario where the values are unchanged from the star schema; in this +scenario, cells cannot be modified. + +A provider may provide
+a The Scenario dimension behaves in the way you would expect. For example, if a
+query contains a slicer A particular provider may provide a +means to save a scenario. (Say, to modify the fact table, or save the scenario +to disk in some other format.) + +A particular provider may +support access control to scenarios. (For example, a particular +scenario is invisible to role A, visible but read-only to role B, and +read-write to role C.) + +Methods of the Scenario class: +
Other methods relating to scenarios: +
2.11. Notifications+ +NOTE: As of olap4j 1.0, +this functionality is experimental and is subject to change in future +releases. + +The The client can ask the server to provide the listener with a +specific granularity of events, but the server can decline to provide +that granularity. + +Fine granularity deals with changes such as cell values changing +(and reports the before and after value, before and after formatted +value), positions being deleted, positions being changed. + +When an atomic change happens on the server (say a cache flush, if
+the server is mondrian) then an event will arrive on the client
+containing all of those changes. Although
+ At any point, the server is free to throw up its hands and say
+'there are too many changes' by sending null values
+for The client should always be ready for that to happen (even for +providers that claim to provide fine granularity events), and should +re-execute the query to get the cell set. In fact, we recommend that +clients re-execute the query to get a new cellset whenever they get an +event. Then the client can use the details in the event to highlight +cells that have changed. + +Methods on interface CellSetListener: +
Methods on interface CellSetChange: +
Methods on interface AxisChange: +
Methods on interface CellChange: +
Other methods: +
Notes for implementors+ +The purpose of registering a listener before creating a cell set is +to ensure that no events "leak out" between creating a cell set and +registering a listener, or while a statement is being re-executed to +produce a new cell set. + +The If changes are occurring regularly on the server, there will soon
+be a call to
+ The granularity parameter is provided to
+ 2.12. Drill through+ +olap4j provides two ways of drilling through to get the collection of +atomic rows underlying a given cell. + +
The Note that we call the 3. Other topics-In this section we discuss aspects of the design and usage of olap4j which + + In this section we discuss aspects of the design and usage of olap4j which pervade all of the components. +3.1. Internationalization-Metadata elements in olap4j can be localized. Unlike the tables and columns -model of relational databases and JDBC, elements of an OLAP data model appear on -the screen of the end-user, and the user expects these elements to appear in his -or her own language. -A connection has a locale. For most drivers, this can be initialized using a
-connection parameter called Metadata elements Cube, Dimension, Hierarchy, Level, Member and so forth have
-methods Suppose one cube is available in English and French, and in French and
-Spanish, and both are shown in same portal. Clients typically say that seeing
-reports in a mixture of languages is confusing; the portal would figure out the
-best common language, in this case French. The
-Cube and
-Schema objects have 3.2. Concurrency and thread-safety-The JDBC 4.0 specification describes the thread-safety requirements for -drivers, and what modes of concurrency JDBC applications can assume that their -drivers will support. Since the olap4j specification is an extension to the JDBC -specification, an olap4j driver must comply with the JDBC specification in this -regard. + +Metadata elements in olap4j can be localized. Unlike the tables and +columns model of relational databases and JDBC, elements of an OLAP +data model appear on the screen of the end-user, and the user expects +these elements to appear in his or her own language. + +A connection has a locale. For most drivers, this can be initialized
+using a connection parameter called Metadata elements Cube, Dimension, Hierarchy, Level, Member and so
+forth have methods Suppose one cube is available in English and French, and in French
+and Spanish, and both are shown in same portal. Clients typically say
+that seeing reports in a mixture of languages is confusing; the portal
+would figure out the best common language, in this case French. The
+Cube
+and Schema
+objects have 3.2. Concurrency and +thread-safety+ +The JDBC 4.0 specification describes the thread-safety requirements +for drivers, and what modes of concurrency JDBC applications can assume +that their drivers will support. Since the olap4j specification is an +extension to the JDBC specification, an olap4j driver must comply with +the JDBC specification in this regard. +3.3. Canceling statements+The JDBC specification provides the - -Statement.cancel() method, so that a statement which is executing in one thread may be safely terminated by another -thread; and - -Statement.setQueryTimeout(int seconds), to request that a statement aborts -itself after executing for a certain period of time. +Statement.cancel() +method, so that a statement which is executing in one thread may be +safely terminated by another thread; and +Statement.setQueryTimeout(int +seconds), to request that a statement aborts itself after executing +for a certain period of time.4. Other components@@ -3604,7 +3944,7 @@4.1. Test suiteof tests which can be used to verify the compliance of an implementation of the API. -4.2. XML/A provider+4.2. XML/A providerThe XML/A provider is an implementation of the olap4j API which talks to a generic XML/A provider. @@ -3612,14 +3952,16 @@4.2. XML/A providerSince there are many XML/A providers, and some of them require requests in a particular format and/or produce idiosyncratic responses, the XML/A provider will come in several flavors. -The XML/A provider is being developed in the same source-code repository as
-olap4j, in a Java package The XML/A provider is being developed in the same source-code repository as
+olap4j, in a Java package 5. Non-functionalityHere are some of the areas of functionality which will not be part of olap4j: +
5. Non-functionality6. Related projects6.1. Mondrian provider+The Mondrian project contains an implementation of the olap4j +API based on +the Mondrian OLAP engine, namely the mondrian.olap4j.MondrianOlap4jDriver driver. It is the reference implementation of olap4j. + +6.2. XML for Analysis provider-The Mondrian project will contain an implementation of the olap4j API based on -the Mondrian OLAP engine. -This code is currently being developed the same source-code repository as -olap4j, and is the reference implementation of olap4j. The code will be -contributed to the mondrian project in the mondrian-3.0 release, when olap4j -will become mondrian's primary API, and the mondrian team will take over the development -of the mondrian provider. - -6.2. XML for Analysis provider-We intend to create an a driver which implements the olap4j API on top of any -XML/A data source. -This code is currently being developed in the same source-code repository as -olap4j, but will never be part of any olap4j release, and will be spun off as a -separate project before olap4j 1.0. +We intend to create an a driver which implements the olap4j API on +top of any XML/A data source. + +This code is currently being developed in the same source-code +repository as olap4j, but will be spun off as a separate project at some point. 6.3. Other data sources-In principle, providers could be created to other OLAP data sources. This -would be particularly straightforward for servers which already have a native -Java API. +In principle, providers could be created to other OLAP data +sources. This would be particularly straightforward for servers which +already have a native Java API. + +6.4 xmla4js-Appendix A. Opportunities for specification+xmla4js is a JavaScript front-end to XML/A. -The following are features which have been suggested for inclusion in the -olap4j specification, but which are not part of the current version. They may be + + Appendix A. Opportunities +for specification+ +The following are features which have been suggested for inclusion +in the +olap4j specification, but which are not part of the current version. +They may be included in future revisions of the specification. A.1. Date and Time types@@ -3675,14 +4021,6 @@A.2. Schema notificationthose changes are.(Richard Emberson, 2006/8/15) -A.3. Writethrough/Writeback-Specify how clients can write cell values back to the database. Useful for -budgeting applications and 'what if?' analysis. -(PALO, 2006/10/14) -A.4. Drillthrough-Mondrian exposes the SQL statement used to form the result set, and exposes -the mapping from columns to members/levels, whereas olap4j currently only -returns a result set. Appendix B. Feedback@@ -3703,76 +4041,76 @@Appendix C. Open issuesAppendix D. Miscellaneous-D.1. To be specified- -[Method for richer query of members, analogous to OlapDatabaseMetaData.getMembers(). Maybe extend Cube.lookupMember. Something with a treeop.] -[Discuss thread safety of connections, statements, result sets.] -[API for canceling statements.] -[2006/10/20#1. Specification should include compliance levels, like the SQL -specification does. In particular, we will allow providers to comply with a -limited subset of MDX.] -[2006/10/20#3. Need to allow clients to access the members on a ResultAxis -via a list (for convenience) and via an iterator. Iterators need to be -restartable, but not bidirectional. Need to know the size of the axes, even if -using the iterator interface.] -[2006/10/20#6. We discussed session support. It is necessary for write-back. -JDBC's 'stateful session' is difficult to implement over a stateless protocol -like HTTP. Michael suggested adding 'session name' as a parameter to 'execute' -methods. Julian disagreed. No conclusion reached.] -[2006/10/20#7. We discussed the goals and intended audience of olap4j. The -audience spans from a beginner's audience (only 2 hours experience with the API) -who don't want to write a lot of code, to writers of clients (2 yrs experience -with the API) who want performance and don't care how much code they need to -write. Distributed clients (e.g. olap4j provider for XMLA) have bandwidth -constraints. Mobile clients also have memory constraints. -ADOMD addressed beginners audience well, but used a lot of memory. Challenge -is to support an object model (hence easy programming model) without increasing -memory. No specific change to the specification, but decided to add memory -efficiency as a design goal.] +D.1. To be specified[2006/10/20#3. Need to allow clients to access the members on a +ResultAxis via a list (for convenience) and via an iterator. Iterators +need to be restartable, but not bidirectional. Need to know the size of +the axes, even if using the iterator interface.] + +[2006/10/20#6. We discussed session support. It is necessary for +write-back. JDBC's 'stateful session' is difficult to implement over a +stateless protocol like HTTP. Michael suggested adding 'session name' +as a parameter to 'execute' methods. Julian disagreed. No conclusion +reached.] + +[2006/10/20#7. We discussed the goals and intended audience of +olap4j. The audience spans from a beginner's audience (only 2 hours +experience with the API) who don't want to write a lot of code, to +writers of clients (2 yrs experience with the API) who want performance +and don't care how much code they need to write. Distributed clients +(e.g. olap4j provider for XMLA) have bandwidth constraints. Mobile +clients also have memory constraints. + +ADOMD addressed beginners audience well, but used a lot of memory. +Challenge is to support an object model (hence easy programming model) +without increasing memory. No specific change to the specification, but +decided to add memory efficiency as a design goal.] +D.2. Design notes-JDK. +JDK+We are targeting JDK 1.5, and running retroweaver for backward compatibility for JDK 1.4. See forum thread: olap4j, JDK 1.5 and generics. We also support JDK 1.6, and with it JDBC 4.0. +Result sets, random access, and memory usage-Should result sets return their axes as cursors or collections? Cursors + + Should result sets return their axes as cursors or collections? Cursors require less memory, but collections provide an easier programming model. -Also on the subject of memory, how to represent the metadata? Schema result -sets require less memory, are more flexible, and have better defined semantics -in the presence of transactions and offline working; but an object model (Cube, + + Also on the subject of memory, how to represent the metadata? Schema result +sets require less memory, are more flexible, and have better defined semantics +in the presence of transactions and offline working; but an object model (Cube, Dimension, Level) provides an easier programming model. +Accessing cells-It would be possible to access cells in a result set (a) by ordinal; (b) by -coordinates; (c) by the 'etchasketch' model determined by the position of the -iterator along each axis, as used by JOLAP. We decided to support (a) and (b) -but not (c). There are methods on CellSet to convert from ordinal to + + It would be possible to access cells in a result set (a) by ordinal; (b) by +coordinates; (c) by the 'etchasketch' model determined by the position of the +iterator along each axis, as used by JOLAP. We decided to support (a) and (b) +but not (c). There are methods on CellSet to convert from ordinal to coordinates and vice versa. -If there is a huge number of cells, the client has limited memory, and
-bandwidth to the server is limited, random access to cells is costly. Michael
-suggested that we add a method If there is a huge number of cells, the client has limited memory, and
+bandwidth to the server is limited, random access to cells is costly. Michael
+suggested that we add a method Appendix E. References1. XMLA: XML for Analysis Specification, version 1.1. +Appendix F. Change log+
diff --git a/doc/olap4j_fs.pdf b/doc/olap4j_fs.pdf index 223b8bc..f89d9e3 100644 Binary files a/doc/olap4j_fs.pdf and b/doc/olap4j_fs.pdf differ diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java b/src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java index 7f125a5..cba2da7 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java @@ -988,10 +988,6 @@ public ResultSet getActions( "ACTION_NAME", wildcard(actionNamePattern)); } - public ResultSet getDatasources() throws OlapException { - return this.getDatabases(); - } - public ResultSet getDatabases() throws OlapException { return getMetadata( XmlaOlap4jConnection.MetadataRequest.DISCOVER_DATASOURCES); diff --git a/src/org/olap4j/metadata/Database.java b/src/org/olap4j/metadata/Database.java index d67aa9e..658ba60 100644 --- a/src/org/olap4j/metadata/Database.java +++ b/src/org/olap4j/metadata/Database.java @@ -22,7 +22,7 @@ * To obtain the collection of databases in the current server, call the * {@link OlapConnection#getOlapDatabases()} method. To obtain the current * active catalog object, to which a connection is bound, use - * {@link OlapConnection#getOlapDatabase()()}. + * {@link OlapConnection#getOlapDatabase()}. * * The hierarchy of metadata objects, rooted at the connection from which
* they are accessed, is as follows:
@@ -72,7 +72,8 @@ public interface Database {
String getName() throws OlapException;
/**
- * Returns a human readable description of this Database.
+ * Returns a human-readable description of this Database.
+ *
* @return The database description. Can be This usually is the server vendor name, for example "Mondrian" or + * "MSOLAP". + * * @return The provider name. * @throws OlapException if error occurs. */ String getProviderName() throws OlapException; /** - * Returns the types of data which are supported by this provider. + * Returns the types of data that are supported by this provider. + * * @return The provider types. * @throws OlapException if error occurs. */ |