From 6c87da115ff5b223b5a81dd298b2ace45fa221fb Mon Sep 17 00:00:00 2001
From: Julian Hyde
- olap4j is an open Java
- API for
- OLAP.
- Think of it as like
- JDBC,
- except for accessing multi-dimensional data.
- olap4j is designed to be
- a common API for any OLAP server, so you can write an
- application on one OLAP server and easily switch it to
- another. And built on that API, there will be a growing
- collection of tools and components. The draft olap4j
- specification, version 0.5, was released on September 2nd,
- 2006. olap4j is an open specification, being developed by a
- consortium of companies and open source projects. Get involved! Join the
- forum, download the specification, and give us
- your feedback. If you are developing an OLAP server, component or
- application, let's work together to make your project olap4j-compliant.
+ olap4j is an open Java
+ API for
+ OLAP.
+ Think of it as like
+ JDBC,
+ except for accessing multi-dimensional data.
+ olap4j is designed to be
+ a common API for any OLAP server, so you can write an
+ application on one OLAP server and easily switch it to
+ another. And built on that API, there will be a growing
+ collection of tools and components. The draft olap4j
+ specification, version 0.5, was released on September 2nd,
+ 2006. olap4j is an open specification, being developed by a
+ consortium of companies and open source projects. Get involved! Join the
+ forum, download the specification, and give us
+ your feedback. If you are developing an OLAP server, component or
+ application, let's work together to make your project olap4j-compliant. Same functionality as JDBC. Here is an example of registering an olap4j driver: Same functionality as JDBC. Same functionality as JDBC. 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 Methods: [move this section elsewhere] 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. Cube and Schema have Package name: org.olap4j
OlapConnection (extends
@@ -497,12 +544,12 @@
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- olap4j
- open java api for
-
- OLAP
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Status
- Participation
-
-
-
-
-
-
-
- Projects
- Companies
-
-
-
-
-
-
-
-
- Resources
-
-
-
-
-
+
+
+
+
diff --git a/doc/olap4j_fs.html b/doc/olap4j_fs.html
index f3e7f48..41f7953 100644
--- a/doc/olap4j_fs.html
+++ b/doc/olap4j_fs.html
@@ -104,15 +104,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ olap4j
+ open java api for
+
+ OLAP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Status
+ Participation
+
+
+
+
+
+
+
+ Projects
+ Companies
+
+
+
+
+
+
+
+ Resources
+
+
+
+
+ Contents
-
Contents
-
-
+
2.1. Driver management
javax.sql.DataSource2.1.1. Driver
+2.1.1. The Driver class
2.1.2. DriverManager
+2.1.2. The DriverManager class
2.1.3. DataSource
+2.1.3. The DataSource interface
2.1.4 The OlapException class
+
+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 ResultCell
+or ResultPosition object where the error occurred. The region
is an
+object representing the textual region in the MDX statement.
+
+
+2.1.5. Internationalization
+
+getSupportedLocales()
methods for this purpose.2.2. Connections
@@ -442,7 +489,7 @@ 2.2. Connections
2.2.1. OlapConnection
+2.2.1. The OlapConnection interface
2.2.2. Connection pooling
be sufficient merely to cast the objects returned from factory methods.
OlapStatement (extends java.sql.Statement) is an object used to execute a static MDX statement and return the result it produces.
-PreparedOlapStatement
(extends
@@ -523,13 +570,19 @@ 2.3.2. PreparedOlapStatement
value until they are set, and then retain their new values for each subsequent
execution of this PreparedOlapStatement
.
[How to find out what cube a prepared statement relates to?]
-OlapParameterMetaData
(extends
java.sql.ParameterMetaData) describes parameters of a
PreparedOlapStatement
.
Additional methods:
+getName()
getOlapType(int param)
OlapResultSet (extends java.sql.ResultSet) is the result of executing an OlapStatement @@ -545,14 +598,45 @@
Additional methods to retrieve the axes of the multidimensional result.
-Additional methods to retrieve the axes of the multidimensional result:
+A ResultAxis is +a
[tbd]
[access positions by index (i.e. a list) and by scrolling (i.e. an iterator)]
-[tbd]
-[tbd]
+ResultPosition +is a position on a +ResultAxis.
+Methods:
+A ResultCell is +a cell returned from an +OlapResultSet.
+Methods:
+[Diagram of object model, showing relationships between Schema, Cube, -Dimension, etc.]
-[Diagram of object model, showing relationships. Catalog contains Schema; +Schema contains Cube and shared Dimension; Cube contains Dimension, Measure and +Set; Measure is a Member; Dimension contains Hierarchy; Hierarchy contains +Level; Level contains Member and Property.]
+Most metadata objects extend the
+MetadataElement interface, which gives them name
and
+uniqueName
attributes, and localized caption
and
+description
.
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 +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
+underlying metadata object. Always use
+
+equals(), not the =
operator, when comparing metadata objects,
+and do not use
+
+IdentityHashMap.
MetadataElement is the base class for Cube, Dimension, Hierarchy, Level, Member, Property; provides name and unique-name properties (not localized), and localized caption and @@ -781,19 +886,31 @@
Catalog ...
+Schema ...
Cube ...
Dimension ...
Hierarchy ...
Level ...
Meaure ...
-Member ...
Measure ...
+Property ...
Schema rowsets are specified as in [XML for Analysis
+
+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. OlapDatabaseMetaData extends Classes: Object model: A transform is an operation which maps a query model to a new query model. It
@@ -3137,6 +3238,10 @@ Specify how clients can write cell values back to the database. Useful for
budgeting applications and 'what if?' analysis. (PALO, 2006/10/14) 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. [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#2. Metadata objects need to be compared using equals, not
-identity. (Michael had war-stories of an OLAP API where members from a result
-set were not equal to members obtained by browsing the schema.)] [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#4. Cells - random access (not the 'etchasketch' model used by
-JOLAP). Access via ordinal, not via a coordinates. Since access to cells is
-random access, it makes it hard for a low-memory provider to access cells
-without many round-trips. We agreed that the provider should try to recognize
-the pattern. John drew the analogy of a modern file system, implementing a
-serial access interface (streams) on top of random-access primitives. Michael
-suggested that we implement a method to get a cell range - the hypercube of
-cells between coordinates minX and maxX, and minY and maxY - but we deferred
-that to a future release.] [2006/10/20#5. Available locales in cubes and schemas. Use case: 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. Add methods to Schema and Cube.] [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'
@@ -3199,23 +3287,34 @@ 2.6.3.
+The OlapDatabaseMetaData
+interface, and methods which return schema rowsets
+2.6.4. Other methods
-
-
-
-
-
-
2.7. Transform
A.3. Writethrough/Writeback
A.4. Drillthrough
+Appendix B. Feedback
@@ -3164,27 +3269,10 @@ D.1. To be specified
D.1. To be specified
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.]
[2006/10/20#8. Need to make shared dimensions accessible from schema.]
-[2006/10/20#9. Need to support drill-through. Method which returns a result -set. (Mondrian exposes the SQL statement used to form the result set, and -exposes the mapping from columns to members/levels, but we will not include this -in the olap4j interface.)]
-[2006/10/20#10. John proposed adding OlapException. These would extend -SQLException, and have a 'Object getContext()' method which would return the -context (member or cell) where the error occurred. New methods would have -'throws OlapException', and existing methods (e.g. Statement.close()) can (at -provider's choice) throw either OlapException or SQLException.]
- +[Is an OlapResultSet still accessible when its OlapStatement is closed?]
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.
+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, +Dimension, Level) provides an easier programming model.
+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 ResultSet 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 List<ResultCell> getCells(int startOrdinal, int
+endOrdinal)
, which matches XML/A behavior, but we declined to add it to the spec
+for now. John drew the analogy of a modern file system, implementing a serial
+access interface (streams) on top of random-access primitives. For now, we
+support only random access, but suggest that the provider looks for patterns of
+access.
Typically used values are ROWS, COLUMNS, and SLICER. + * + * @author jhyde + * @version $Id: $ + * @since Oct 23, 2006 + */ +public enum Axis { + SLICER, + COLUMNS, + ROWS, + PAGES, + CHAPTERS, + SECTIONS; + + /** + * Returns the ordinal which is to be used for retrieving this axis from + * the {@link org.olap4j.OlapResultSet#getAxes()}, or retrieving its + * coordinate from {@link ResultCell#getCoordinateList()}. + * + *
The axis ordinal is one less than the {@link #ordinal} value which
+ * every enum
value possesses. Hence, {@link #SLICER} is -1
+ * (because it is not treated the same as the other axes), {@link #COLUMNS}
+ * is 0, {@link #ROWS} is 1, and so forth.
+ *
+ * @return Axis ordinal
+ */
+ public int axisOrdinal() {
+ return axisOrdinal;
+ }
+
+ private final int axisOrdinal = ordinal() - 1;
+}
+
+// End Axis.java
diff --git a/src/org/olap4j/OlapDatabaseMetaData.java b/src/org/olap4j/OlapDatabaseMetaData.java
index 102afa7..d7c7340 100644
--- a/src/org/olap4j/OlapDatabaseMetaData.java
+++ b/src/org/olap4j/OlapDatabaseMetaData.java
@@ -9,6 +9,8 @@
*/
package org.olap4j;
+import org.olap4j.metadata.Database;
+
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -28,6 +30,12 @@
* @since Oct 12, 2006
*/
public interface OlapDatabaseMetaData extends DatabaseMetaData {
+ /**
+ * Returns the Database
, which is the root of the hierarchy
+ * of metadata objects.
+ * @return the Database
+ */
+ Database getDatabase();
/**
* Retrieves a list of descriptions of an Action.
diff --git a/src/org/olap4j/OlapException.java b/src/org/olap4j/OlapException.java
new file mode 100644
index 0000000..5112fa0
--- /dev/null
+++ b/src/org/olap4j/OlapException.java
@@ -0,0 +1,157 @@
+/*
+// $Id: $
+// This software is subject to the terms of the Common Public License
+// Agreement, available at the following URL:
+// http://www.opensource.org/licenses/cpl.html.
+// Copyright (C) 2006-2006 Julian Hyde
+// All Rights Reserved.
+// You must accept the terms of that agreement to use this software.
+*/
+package org.olap4j;
+
+import java.sql.SQLException;
+
+/**
+ *
An exception describing an error accessing an OLAP database.
+ * + *Since olap4j extends JDBC, it is natural that OlapException
+ * should extend JDBC's {@link 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. This information is
+ *
+ * @author jhyde
+ * @version $Id: $
+ * @since Oct 23, 2006
+ */
+public class OlapException extends SQLException {
+ private Region region;
+ private Object context;
+
+ /**
+ * Constructs a fully-specified SQLException
object.
+ *
+ * @param reason a description of the exception
+ * @param sqlState an XOPEN or SQL 99 code identifying the exception
+ * @param vendorCode a database vendor-specific exception code
+ */
+ public OlapException(String reason, String sqlState, int vendorCode) {
+ super(reason, sqlState, vendorCode);
+ }
+
+ /**
+ * Constructs an SQLException
object with the given reason and
+ * SQLState; the vendorCode
field defaults to 0.
+ *
+ * @param reason a description of the exception
+ * @param sqlState an XOPEN or SQL 99 code identifying the exception
+ */
+ public OlapException(String reason, String sqlState) {
+ super(reason, sqlState);
+ }
+
+ /**
+ * Constructs an SQLException
object with a reason;
+ * the sqlState
field defaults to null
, and
+ * the vendorCode
field defaults to 0.
+ *
+ * @param reason a description of the exception
+ */
+ public OlapException(String reason) {
+ super(reason);
+ }
+
+ /**
+ * Constructs an SQLException
object;
+ * the reason
field defaults to null,
+ * the sqlState
field defaults to null
, and
+ * the vendorCode
field defaults to 0.
+ */
+ public OlapException() {
+ super();
+ }
+
+ /**
+ * Sets the textual region where the exception occurred.
+ */
+ public void setRegion(Region region) {
+ this.region = region;
+ }
+
+ /**
+ * Returns the textual region where the exception occurred, or null if no
+ * region can be identified.
+ */
+ public Region getRegion() {
+ return region;
+ }
+
+ /**
+ * Sets the context where the exception occurred.
+ *
+ * @param context Context where the exception occurred
+ * @throws IllegalArgumentException If context is not a {@link ResultCell}
+ * or a {@link ResultPosition}
+ */
+ public void setContext(Object context) {
+ if (!(context instanceof ResultCell) &&
+ !(context instanceof ResultPosition)) {
+ throw new IllegalArgumentException(
+ "expected ResultCell or ResultPosition");
+ }
+ this.context = context;
+ }
+
+ /**
+ * Returns the context where the exception occurred.
+ * Typically a {@link ResultCell} or a {@link ResultPosition}, or null.
+ */
+ public Object getContext() {
+ return context;
+ }
+
+ /**
+ * Description of the position of a syntax or validation error in the source
+ * MDX string.
+ *
+ *
Row and column positions are 1-based and inclusive. For example, + * in + * + *
+ * SELECT { [Measures].MEMBERS } ON COLUMNS, { } ON ROWS FROM [Sales] + *+ * + * the
SELECT
keyword occupies positions (1, 1) through (1, 6),
+ * and would have a Region(startLine=1, startColumn=1, endColumn=1,
+ * endLine=6)
.
+ */
+ public static final class Region {
+ public final int startLine;
+ public final int startColumn;
+ public final int endLine;
+ public final int endColumn;
+ protected Region(
+ int startLine,
+ int startColumn,
+ int endLine,
+ int endColumn) {
+ this.startLine = startLine;
+ this.startColumn = startColumn;
+ this.endColumn = endLine;
+ this.endLine = endColumn;
+ }
+
+ public String toString() {
+ if (startLine == endColumn && startColumn == endLine) {
+ return "line " + startLine + ", column " + startColumn;
+ } else {
+ return "line " + startLine + ", column " + startColumn +
+ " through line " + endLine + ", column " + endColumn;
+ }
+ }
+ }
+}
+
+// End OlapException.java
diff --git a/src/org/olap4j/OlapResultSet.java b/src/org/olap4j/OlapResultSet.java
index 6a22d48..8effae4 100644
--- a/src/org/olap4j/OlapResultSet.java
+++ b/src/org/olap4j/OlapResultSet.java
@@ -9,15 +9,50 @@
*/
package org.olap4j;
+import org.olap4j.metadata.Property;
+import org.olap4j.metadata.Cube;
+
import java.util.List;
import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
/**
* Result of executing an OLAP Statement.
*
- * It consists of a set of (typically two) axes, each populated with a - * sequence of members, and a collection of cells at the intersection of these - * axes. + *
An Cell ordinals and coordinates There are two ways to identify a particular cell: ordinal and coordinates.
+ * Suppose that there are The ordinal number of a cell whose tuple ordinals are
+ * p
axes, and each axis k
+ * (k
between 0 and p - 1
) has
+ * Uk
positions.
+ * There are U
+ * = U0 * ... * Up - 1
cells in total.
+ * Then:
+ *
+ *
+ * ordinal
is an integer between 0 and
+ * U - 1
.coordinates
are a list of p
integers,
+ * indicating the cell's position on each axis.
+ * Each integer is between 0 and Up-1
.(S0, S1, ... Sp-1)
is
+ *
+ *
+ * Σi=0p-1 Si . Ei
+ *
+ * where
+ * E0 = 1
+ * and
+ *
+ * Ei = Πi=0p-1 Uk
+ *
+ *
OlapResultSet
's axes
+ * and cells.
+ *
+ * @return the description of this OlapResultSet
's axes
+ * and cells
+ * @exception OlapException if a database access error occurs
+ */
+ OlapResultSetMetaData getMetaData() throws OlapException;
+
+ /**
+ * Retrieves a list of ResultAxis objects containing the result.
*
* The list contains axes according to their ordinal: 0 is the columns
* axis, 1 the rows axis, and so forth.
@@ -33,12 +78,43 @@ public interface OlapResultSet extends ResultSet {
List Equivalent to
+ * The mapping
+ * @param coordinates Cell coordinates
+ * @return Cell ordinal
+ */
+ int coordinatesToOrdinal(List For example, in the MDX statement
+ * 0 = ROWS, 1 = COLUMNS, and so forth, as described by the
+ * {@link Axis#axisOrdinal()} method of the {@link Axis} enumeration. The result is identical to evaluating
+ * This method can be called at any time. In particular, it is not
+ * necessary to complete an iteration through all positions before calling
+ * this method. The number of positions on an axis is important when computing the
+ * ordinal of a cell. The formula is the sequence, zero-based, which the cell would be
+ * visited in a raster-scan through all of the cells of this
+ * {@link OlapResultSet}. The ordinal of the first cell is zero, and the
+ * ordinal of the last cell is the product of the lengths of the axes, minus
+ * 1. For example, if a result has 10 columns and 20
+ * rows, then: This method is provided for convenience. It is equivalent to the
+ * following code:
+ * Recall that the {@link OlapResultSetAxisMetaData#getHierarchies()}
+ * method describes the hierarchies which occur on an axis. The positions on
+ * that axis must conform. Suppose that the ROWS axis of a given statement
+ * returns Consider the following use case. 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. This method allows the client to choose
+ * the most appropriate locale. The list is advisory: a client is free to choose another locale,
+ * in which case, the server will probably revert to the base locale for
+ * locale-specific behavior such as captions and formatting. Many dimensions have only one Hierarchy, whose name is the same as the
* Dimension.
+ *
+ * @see org.olap4j.OlapDatabaseMetaData#getHierarchies
*/
- NamedList If the dimension has an 'all' member, then this will be the sole
* root member.
*/
- NamedList If access-control is in place, the list does not contain inaccessible
* children.
+ *
+ * @see org.olap4j.OlapDatabaseMetaData#getMembers()
*/
NamedList Every member has certain system properties such as "name" and
* "caption" (the full list is described in the {@link Property}
- * ({@link org.olap4j.Todo} move Property)
+ * ({@link org.olap4j.Todo todo: move Property})
* enumeration), as well as extra properties defined for its Level
* (see {@link Level#getProperties()}
*
diff --git a/src/org/olap4j/metadata/Schema.java b/src/org/olap4j/metadata/Schema.java
index af0075d..241e958 100644
--- a/src/org/olap4j/metadata/Schema.java
+++ b/src/org/olap4j/metadata/Schema.java
@@ -9,6 +9,13 @@
*/
package org.olap4j.metadata;
+import mondrian.xmla.DataSourcesConfig;
+
+import java.util.Locale;
+import java.util.Collection;
+
+import org.olap4j.OlapException;
+
/**
* Consider the following use case. 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. This method allows the client to choose
+ * the most appropriate locale. The list is advisory: a client is free to choose another locale,
+ * in which case, the server will probably revert to the base locale for
+ * locale-specific behavior such as captions and formatting.
+ *
+ * @see Cube#getSupportedLocales
+ *
+ * @return List of locales for which this
+ *
+ * @param ordinal 0-based ordinal of the cell
+ * @return Cell
+ */
+ ResultCell getCell(int ordinal);
+
+ /**
+ * Converts a cell ordinal to a list of cell coordinates.
+ *
+ * @param ordinal Cell ordinal
+ * @return Cell coordinates
+ */
+ List
+ * getCell(ordinalToCoordinates(ordinal)
+ *
+ *
+ *
+ * the ROWS axis is described by the following metadata:
+ *
+ *
+ * SELECT
+ *
+ * {[Measures].Members} ON COLUMNS,
+ * CrossJoin([Store].Members, [Gender].Children)
+ * DIMENSION PROPERTIES
+ * MEMBER_ORDINAL,
+ * MEMBER_UNIQUE_NAME,
+ * DISPLAY_INFO ON ROWS
+ * FROM [Sales]
+ *
+ *
+ *
+ * @author jhyde
+ * @version $Id: $
+ * @since Oct 23, 2006
+ */
+public interface OlapResultSetAxisMetaData {
+ /**
+ * Returns the definition of the axis.
+ * ({@link Axis#SLICER}, {@link Axis#ROWS}, and so forth.)
+ */
+ Axis getAxis();
+
+ /**
+ * Returns the hierarchies which are mapped onto this axis.
+ */
+ List
+ *
+ * Attribute
+ * Value
+ *
+ *
+ * hierarchies
+ * {[Store], [Gender]}
+ *
+ *
+ * properties
+ * {MEMBER_ORDINAL, MEMBER_UNIQUE_NAME, DISPLAY_INFO}
+ * OlapResultSetMetaData
...
+ *
+ * @author jhyde
+ * @version $Id: $
+ * @since Oct 23, 2006
+ */
+public interface OlapResultSetMetaData extends ResultSetMetaData {
+ /**
+ * Returns a list of properties which each ResultCell may have.
+ */
+ ListResultAxis
...
*
@@ -21,25 +26,57 @@
* @since Aug 22, 2006
*/
public interface ResultAxis {
- int SLICER = 0;
- int COLUMNS = 1;
- int ROWS = 2;
+ /**
+ * Returns the ordinal of this ResultAxis
.
+ *
+ * ResultAxis
+ * belongs to.
+ */
+ OlapResultSet getResultSet();
/**
- * Returns a list of positions on this axis.
- * @return
+ * Returns a description of the type (e.g. {@link Axis#ROWS}) of this
+ * axis, and the hierarchies and properties which will be found on it.
+ *
+ *
+ *
+ */
+ OlapResultSetAxisMetaData getAxisMetaData();
+
+ /**
+ * Returns a list of
+ * getResultSet().getMetaData().getAxesMetaData(getOrdinal())
+ *
+ * ResultPosition
objects on this ResultAxis.
+ *
+ * @return List of positions on this axis (never null)
*/
ListResultCell
...
+ * Cell returned from a {@link OlapResultSet}.
*
* @author jhyde
* @version $Id$
* @since Aug 22, 2006
*/
public interface ResultCell {
+ /**
+ * Returns the {@link OlapResultSet} that this ResultCell belongs to.
+ *
+ * @return OlapResultSet, never null
+ */
+ OlapResultSet getResultSet();
+
+ /**
+ * Returns the ordinal of this ResultCell.
+ *
+ *
+ *
+ */
+ int getOrdinal();
+
+ /**
+ * Returns the coordinates of this ResultCell in its {@link ResultAxis}.
+ *
+ *
+ *
+ */
+ List
+ * getResult().ordinalToCoordinateList(getOrdinal())
+ *
+ * double
value.
+ */
+ double getDoubleValue() throws OlapException;
+
+ /**
+ * @see Todo
+ */
+ String getErrorText();
+
+ /**
+ * @see Todo
+ * returns a OlapException if the cell is an error
+ */
+ Object getValue();
+
+ /**
+ * Returns the value of this ResultCell, formatted according to the
+ * FORMAT_STRING property and using the numeric formatting tokens the
+ * current locale.
+ *
+ * @return Formatted value of this ResultCell
+ */
String getFormattedValue();
+
+ /**
+ * Drills through from this cell to the underlying fact table data,
+ * and returns a {@link java.sql.ResultSet} of the results.
+ */
+ ResultSet drillThrough();
}
// End ResultCell.java
diff --git a/src/org/olap4j/ResultPosition.java b/src/org/olap4j/ResultPosition.java
index 8a482aa..6e78c38 100644
--- a/src/org/olap4j/ResultPosition.java
+++ b/src/org/olap4j/ResultPosition.java
@@ -14,18 +14,30 @@
import java.util.List;
/**
- * ResultPosition
...
+ * Position on one of the {@link ResultAxis} objects in a {@link OlapResultSet}.
*
* @author jhyde
* @version $Id$
* @since Aug 22, 2006
*/
public interface ResultPosition {
+ /**
+ * Returns the list of Member objects at this position.
+ *
+ * {[Gender], [Store]}
. Then every ResultPosition on
+ * that axis will have two members: the first a member of the [Gender]
+ * dimension, the second a member of the [Store] dimension.Catalog
...
+ *
+ * @author jhyde
+ * @version $Id: $
+ * @since Oct 24, 2006
+ */
+public interface Catalog {
+ /**
+ * Returns a list of {@link Schema} objects which belong to
+ * this Catalog
.
+ *
+ * @see org.olap4j.OlapDatabaseMetaData#getSchemas
+ * @return List of Schema in this Catalog
+ */
+ NamedListCube
...
*
@@ -17,8 +21,47 @@
* @since Aug 22, 2006
*/
public interface Cube extends MetadataElement {
+ /**
+ * Returns the {@link Schema} this Cube belongs to.
+ */
Schema getSchema();
+
+ /**
+ * Returns a list of {@link Dimension} objects in this Cube.
+ *
+ * @see org.olap4j.OlapDatabaseMetaData#getDimensions()
+ */
NamedListCube
has been localized.
+ *
+ * Cube
has been
+ * localized
+ */
+ CollectionDatabase
...
+ *
+ * @author jhyde
+ * @version $Id: $
+ * @since Oct 24, 2006
+ */
+public interface Database {
+ /**
+ * Retrieves a list of {@link Catalog} objects which
+ * belong to this Database
.
+ *
+ * @see org.olap4j.OlapDatabaseMetaData#getDatabase
+ * @return List of Catalogs in this Database
+ */
+ NamedListDimension
...
*
@@ -23,8 +25,10 @@ public interface Dimension extends MetadataElement {
*
* Dimension
.
diff --git a/src/org/olap4j/metadata/Hierarchy.java b/src/org/olap4j/metadata/Hierarchy.java
index 3008099..873065f 100644
--- a/src/org/olap4j/metadata/Hierarchy.java
+++ b/src/org/olap4j/metadata/Hierarchy.java
@@ -29,6 +29,8 @@ public interface Hierarchy extends MetadataElement {
/**
* Returns a list of the {@link Level}s in this Hierarchy.
+ *
+ * @see org.olap4j.OlapDatabaseMetaData#getLevels
*/
NamedListMember
is a data value in a in an OLAP Dimension.
+ * Member
is a data value in an OLAP Dimension.
*
* @author jhyde
* @version $Id$
@@ -28,6 +28,8 @@ public interface Member extends MetadataElement {
*
* Schema
...
*
@@ -17,7 +24,48 @@
* @since Oct 13, 2006
*/
public interface Schema {
- NamedListSchema
belongs to.
+ */
+ Catalog getCatalog();
+
+ /**
+ * Returns a list of cubes in this Schema
.
+ *
+ * @see org.olap4j.OlapDatabaseMetaData#getCubes
+ * @return List of cubes in this Schema
+ */
+ NamedListSchema
.
+ *
+ * @see org.olap4j.OlapDatabaseMetaData#getDimensions()
+ */
+ NamedListSchema
has been localized.
+ *
+ * Schema
has been
+ * localized
+ */
+ Collection