001 /* 002 // $Id: CellSetMetaData.java 482 2012-01-05 23:27:27Z jhyde $ 003 // 004 // Licensed to Julian Hyde under one or more contributor license 005 // agreements. See the NOTICE file distributed with this work for 006 // additional information regarding copyright ownership. 007 // 008 // Julian Hyde licenses this file to you under the Apache License, 009 // Version 2.0 (the "License"); you may not use this file except in 010 // compliance with the License. You may obtain a copy of the License at: 011 // 012 // http://www.apache.org/licenses/LICENSE-2.0 013 // 014 // Unless required by applicable law or agreed to in writing, software 015 // distributed under the License is distributed on an "AS IS" BASIS, 016 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 017 // See the License for the specific language governing permissions and 018 // limitations under the License. 019 */ 020 package org.olap4j; 021 022 import org.olap4j.metadata.*; 023 024 import java.sql.ResultSetMetaData; 025 026 /** 027 * An object that can be used to get information about the axes 028 * and cells in a <code>CellSet</code> object. 029 * 030 * <p>The following code fragment creates the <code>CellSet</code> object cs, 031 * creates the <code>CellSetMetaData</code> object csmd, and uses csmd 032 * to find out how many axes cs has and the name of the cube. 033 * 034 * <blockquote> 035 * <pre> 036 * CellSet cs = stmt.executeOlapQuery( 037 * "SELECT {[Measures].[Unit Sales] ON COLUMNS,\n" + 038 * " Crossjoin([Time].Children, [Store].Children) ON ROWS\n" + 039 * "FROM [Sales]"); 040 * CellSetMetaData csmd = cs.getMetaData(); 041 * int numberOfAxes = csmd.getAxesMetaData().size(); 042 * String cubeName = csmd.getCube().getName(); 043 * </pre> 044 * </blockquote> 045 * 046 * @author jhyde 047 * @version $Id: CellSetMetaData.java 482 2012-01-05 23:27:27Z jhyde $ 048 * @since Oct 23, 2006 049 */ 050 public interface CellSetMetaData extends ResultSetMetaData, OlapWrapper { 051 /** 052 * Returns a list of Property objects which each Cell may have. 053 * 054 * @return list of cell properties 055 */ 056 NamedList<Property> getCellProperties(); 057 058 /** 059 * Returns the Cube which was referenced in this statement. 060 * 061 * @return cube referenced in this statement 062 */ 063 Cube getCube(); 064 065 /** 066 * Returns a list of CellSetAxisMetaData describing each result axis. 067 * 068 * @return list of metadata describing each result axis 069 */ 070 NamedList<CellSetAxisMetaData> getAxesMetaData(); 071 072 /** 073 * Returns a CellSetAxisMetaData describing the filter axis. Never returns 074 * null; if the MDX statement contains no WHERE clause, the description of 075 * the filter contains no hierarchies. 076 * 077 * @return metadata describing filter axis 078 */ 079 CellSetAxisMetaData getFilterAxisMetaData(); 080 } 081 082 // End CellSetMetaData.java