当前位置: 首页>>代码示例>>Java>>正文


Java RolapStar类代码示例

本文整理汇总了Java中mondrian.rolap.RolapStar的典型用法代码示例。如果您正苦于以下问题:Java RolapStar类的具体用法?Java RolapStar怎么用?Java RolapStar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RolapStar类属于mondrian.rolap包,在下文中一共展示了RolapStar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ListPredicate

import mondrian.rolap.RolapStar; //导入依赖的package包/类
protected ListPredicate(List<StarPredicate> predicateList) {
    columnBitKey = null;
    childrenHashMap = null;
    hashValue = 0;
    for (StarPredicate predicate : predicateList) {
        if (columnBitKey == null) {
            columnBitKey =
                predicate.getConstrainedColumnBitKey().copy();
        } else {
            columnBitKey =
                columnBitKey.or(predicate.getConstrainedColumnBitKey());
        }
        children.add(predicate);
        for (RolapStar.Column column
            : predicate.getConstrainedColumnList())
        {
            if (!columns.contains(column)) {
                columns.add(column);
            }
        }
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:23,代码来源:ListPredicate.java

示例2: AbstractColumnPredicate

import mondrian.rolap.RolapStar; //导入依赖的package包/类
/**
 * Creates an AbstractColumnPredicate.
 *
 * @param constrainedColumn Constrained column
 */
protected AbstractColumnPredicate(RolapStar.Column constrainedColumn) {
    this.constrainedColumn = constrainedColumn;
    /*
     * Check if contraintedColumns are null.
     * (Example: FastBatchingCellReader.testAggregateDistinctCount5()).
     */
    if (constrainedColumn != null && constrainedColumn.getTable() != null) {
        constrainedColumnBitKey =
            BitKey.Factory.makeBitKey(
                constrainedColumn.getStar().getColumnCount());
        constrainedColumnBitKey.clear();
        constrainedColumnBitKey.set(constrainedColumn.getBitPosition());
    } else {
        constrainedColumnBitKey = null;
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:22,代码来源:AbstractColumnPredicate.java

示例3: loadGroupingColumnBitKeys

import mondrian.rolap.RolapStar; //导入依赖的package包/类
private void loadGroupingColumnBitKeys() {
    int bitKeyLength = getDefaultColumns().length;
    for (RolapStar.Column[] groupingSetColumns : groupingSetsColumns) {
        BitKey groupingColumnsBitKey =
            BitKey.Factory.makeBitKey(bitKeyLength);
        Set<RolapStar.Column> columns =
            convertToSet(groupingSetColumns);
        int bitPosition = 0;
        for (RolapStar.Column rollupColumn : rollupColumns) {
            if (!columns.contains(rollupColumn)) {
                groupingColumnsBitKey.set(bitPosition);
            }
            bitPosition++;
        }
        rollupColumnsBitKeyList.add(groupingColumnsBitKey);
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:18,代码来源:GroupingSetsList.java

示例4: RangeColumnPredicate

import mondrian.rolap.RolapStar; //导入依赖的package包/类
/**
 * Creates a RangeColumnPredicate.
 *
 * @param column Constrained column
 * @param lowerInclusive Whether range includes the lower bound;
 *   must be false if not bounded below
 * @param lowerBound Lower bound, or null if not bounded below
 * @param upperInclusive Whether range includes the upper bound;
 *   must be false if not bounded above
 * @param upperBound Upper bound, or null if not bounded above
 */
public RangeColumnPredicate(
    RolapStar.Column column,
    boolean lowerInclusive,
    ValueColumnPredicate lowerBound,
    boolean upperInclusive,
    ValueColumnPredicate upperBound)
{
    super(column);
    assert lowerBound == null
        || lowerBound.getConstrainedColumn() == column;
    assert !(lowerBound == null && lowerInclusive);
    assert upperBound == null
        || upperBound.getConstrainedColumn() == column;
    assert !(upperBound == null && upperInclusive);
    this.lowerInclusive = lowerInclusive;
    this.lowerBound = lowerBound;
    this.upperInclusive = upperInclusive;
    this.upperBound = upperBound;
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:31,代码来源:RangeColumnPredicate.java

示例5: extraPredicates

import mondrian.rolap.RolapStar; //导入依赖的package包/类
/**
 * Adds predicates not associated with columns.
 *
 * @param sqlQuery Query
 */
protected void extraPredicates(SqlQuery sqlQuery) {
    List<StarPredicate> predicateList = getPredicateList();
    for (StarPredicate predicate : predicateList) {
        for (RolapStar.Column column
            : predicate.getConstrainedColumnList())
        {
            final RolapStar.Table table = column.getTable();
            table.addToFrom(sqlQuery, false, true);
        }
        StringBuilder buf = new StringBuilder();
        predicate.toSql(sqlQuery, buf);
        final String where = buf.toString();
        if (!where.equals("true")) {
            sqlQuery.addWhere(where);
        }
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:23,代码来源:AbstractQuerySpec.java

示例6: lookupInChildren

import mondrian.rolap.RolapStar; //导入依赖的package包/类
protected RolapStar.Column lookupInChildren(
    final RolapStar.Table table,
    final String factColumnName)
{
    // This can happen if we are looking at a collapsed dimension
    // table, and the collapsed dimension in question in the
    // fact table is a snowflake (not just a star), so we
    // must look deeper...
    for (RolapStar.Table child : table.getChildren()) {
        RolapStar.Column rc = child.lookupColumn(factColumnName);
        if (rc != null) {
            return rc;
        } else {
            rc = lookupInChildren(child, factColumnName);
            if (rc != null) {
                return rc;
            }
        }
    }
    return null;
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:22,代码来源:Recognizer.java

示例7: findCubes

import mondrian.rolap.RolapStar; //导入依赖的package包/类
/**
 * Finds all cubes that use this fact table.
 */
protected List<RolapCube> findCubes() {
    String name = dbFactTable.getName();

    List<RolapCube> list = new ArrayList<RolapCube>();
    RolapSchema schema = star.getSchema();
    for (RolapCube cube : schema.getCubeList()) {
        if (cube.isVirtual()) {
            continue;
        }
        RolapStar cubeStar = cube.getStar();
        String factTableName = cubeStar.getFactTable().getAlias();
        if (name.equals(factTableName)) {
            list.add(cube);
        }
    }
    return list;
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:21,代码来源:Recognizer.java

示例8: getNameExp

import mondrian.rolap.RolapStar; //导入依赖的package包/类
private String getNameExp(
    Result result,
    String hierName,
    String levelName)
{
    final Cube cube = result.getQuery().getCube();
    RolapStar star = ((RolapCube) cube).getStar();

    Hierarchy h =
        cube.lookupHierarchy(
            new Id.Segment(hierName, Id.Quoting.UNQUOTED), false);
    if (h == null) {
        return null;
    }
    for (Level l : h.getLevels()) {
        if (l.getName().equals(levelName)) {
            MondrianDef.Expression exp = ((RolapLevel) l).getNameExp();
            String nameExpStr = exp.getExpression(star.getSqlQuery());
            nameExpStr = nameExpStr.replace('"', '`') ;
            return nameExpStr;
        }
    }
    return null;
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:25,代码来源:DrillThroughTest.java

示例9: estimateSpaceForColumn

import mondrian.rolap.RolapStar; //导入依赖的package包/类
static double estimateSpaceForColumn(final RolapStar.Column column) {
    switch (column.getDatatype()) {
    case Boolean:
        return 1;
    case Date:
        return 4;
    case Integer:
        return 4;
    case Numeric:
        return 4;
    case String:
        return 20;
    case Time:
        return 4;
    case Timestamp:
        return 8;
    default:
        throw Util.unexpected(column.getDatatype());
    }
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:21,代码来源:MondrianSchemaLoader.java

示例10: MondrianSchema

import mondrian.rolap.RolapStar; //导入依赖的package包/类
public MondrianSchema(RolapConnection conn, RolapCube cube) {
  this.connection = conn;
  this.cube = cube;
  RolapStar star = cube.getStar();
  dialect = new MondrianDialect(star.getSqlQueryDialect());
  final RolapStar.Table factTable = star.getFactTable();
  final Locus locus =
      new Locus(
          new Execution(conn.getInternalStatement(),0),
          "MondrianSchema.init",
          "while loading the MondrianSchema into the Aggregation Designer.");
  Locus.push(locus);
  try {
      doTable(null, factTable);
      doCube(cube);
  } finally {
      Locus.pop(locus);
  }
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:20,代码来源:MondrianSchema.java

示例11: getColumn

import mondrian.rolap.RolapStar; //导入依赖的package包/类
public AggStar.Table.Column getColumn(final int i) {
    RolapStar.Column[] columns = segment0.getColumns();
    int bitPos = columns[i].getBitPosition();
    AggStar.Table.Column column = aggStar.lookupColumn(bitPos);

    // this should never happen
    if (column == null) {
        LOGGER.error("column null for bitPos=" + bitPos);
    }
    return column;
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:12,代码来源:AggQuerySpec.java

示例12: addGroupingSets

import mondrian.rolap.RolapStar; //导入依赖的package包/类
private void addGroupingSets(SqlQuery sqlQuery) {
    List<RolapStar.Column[]> groupingSetsColumns =
        groupingSetsList.getGroupingSetsColumns();
    for (RolapStar.Column[] groupingSetColumns : groupingSetsColumns) {
        ArrayList<String> groupingColumnsExpr = new ArrayList<String>();

        for (RolapStar.Column aColumnArr : groupingSetColumns) {
            groupingColumnsExpr.add(findColumnExpr(aColumnArr, sqlQuery));
        }
        sqlQuery.addGroupingSet(groupingColumnsExpr);
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:13,代码来源:AggQuerySpec.java

示例13: generateSql

import mondrian.rolap.RolapStar; //导入依赖的package包/类
protected void generateSql(final SqlQuery sqlQuery) {
    // add constraining dimensions
    int columnCnt = getColumnCount();
    for (int i = 0; i < columnCnt; i++) {
        AggStar.Table.Column column = getColumn(i);
        AggStar.Table table = column.getTable();
        table.addToFrom(sqlQuery, false, true);

        String expr = column.generateExprString(sqlQuery);

        StarColumnPredicate predicate = getPredicate(i);
        final String where = RolapStar.Column.createInExpr(
            expr,
            predicate,
            column.getDatatype(),
            sqlQuery);
        if (!where.equals("true")) {
            sqlQuery.addWhere(where);
        }

        final String alias =
            sqlQuery.addSelect(expr, column.getInternalType());
        if (rollup) {
            sqlQuery.addGroupBy(expr, alias);
        }
    }

    // Add measures.
    // This can also add non-shared local dimension columns, which are
    // not measures.
    for (int i = 0, count = getMeasureCount(); i < count; i++) {
        addMeasure(i, sqlQuery);
    }
    addGroupingSets(sqlQuery);
    addGroupingFunction(sqlQuery);
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:37,代码来源:AggQuerySpec.java

示例14: DrillThroughCellRequest

import mondrian.rolap.RolapStar; //导入依赖的package包/类
public DrillThroughCellRequest(
    RolapStar.Measure measure,
    boolean extendedContext, List<OlapElement> nonApplicableFields)
{
    super(measure, extendedContext, true);
    this.nonApplicableMembers = nonApplicableFields;
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:8,代码来源:DrillThroughCellRequest.java

示例15: includeInSelect

import mondrian.rolap.RolapStar; //导入依赖的package包/类
public boolean includeInSelect(RolapStar.Column column) {
    if (drillThroughColumns.size() == 0
        && drillThroughMeasures.size() == 0)
    {
        return true;
    }
    return drillThroughColumns.contains(column);
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:9,代码来源:DrillThroughCellRequest.java


注:本文中的mondrian.rolap.RolapStar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。