001/*
002// This software is subject to the terms of the Eclipse Public License v1.0
003// Agreement, available at the following URL:
004// http://www.eclipse.org/legal/epl-v10.html.
005// You must accept the terms of that agreement to use this software.
006//
007// Copyright (C) 2001-2005 Julian Hyde
008// Copyright (C) 2005-2011 Pentaho and others
009// All Rights Reserved.
010//
011// jhyde, 30 August, 2001
012*/
013package mondrian.rolap.agg;
014
015import mondrian.rolap.*;
016import mondrian.util.Pair;
017
018import java.util.List;
019
020/**
021 * Contains the information necessary to generate a SQL statement to
022 * retrieve a set of cells.
023 *
024 * @author jhyde
025 * @author Richard M. Emberson
026 */
027public interface QuerySpec {
028    RolapStar getStar();
029    int getMeasureCount();
030    RolapStar.Measure getMeasure(int i);
031    String getMeasureAlias(int i);
032    RolapStar.Column[] getColumns();
033    String getColumnAlias(int i);
034
035    /**
036     * Returns the predicate on the <code>i</code>th column.
037     *
038     * <p>If the column is unconstrained, returns
039     * {@link LiteralStarPredicate}(true).
040     *
041     * @param i Column ordinal
042     * @return Constraint on column
043     */
044    StarColumnPredicate getColumnPredicate(int i);
045
046    Pair<String, List<SqlStatement.Type>> generateSqlQuery();
047}
048
049// End QuerySpec.java