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


Java RolapUtil.sqlNullValue方法代码示例

本文整理汇总了Java中mondrian.rolap.RolapUtil.sqlNullValue方法的典型用法代码示例。如果您正苦于以下问题:Java RolapUtil.sqlNullValue方法的具体用法?Java RolapUtil.sqlNullValue怎么用?Java RolapUtil.sqlNullValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mondrian.rolap.RolapUtil的用法示例。


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

示例1: checkInList

import mondrian.rolap.RolapUtil; //导入方法依赖的package包/类
public BitKey checkInList(BitKey inListLHSBitKey) {
    // ValueColumn predicate by itself is not using IN list; when it is
    // one of the children to an OR predicate, then using IN list
    // is helpful. The later is checked by passing in a bitmap that
    // represent the LHS or the IN list, i.e. the column that is
    // constrained by the OR.
    BitKey inListRHSBitKey = inListLHSBitKey.copy();

    if (!getConstrainedColumnBitKey().equals(inListLHSBitKey)
        || value == RolapUtil.sqlNullValue)
    {
        inListRHSBitKey.clear();
    }

    return inListRHSBitKey;
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:17,代码来源:ValueColumnPredicate.java

示例2: toArray

import mondrian.rolap.RolapUtil; //导入方法依赖的package包/类
private static Comparable[] toArray(
    SortedSet<Comparable> keySet,
    boolean hasNull)
{
    int size = keySet.size();
    if (hasNull) {
        size++;
    }
    Comparable[] keys = keySet.toArray(new Comparable[size]);
    if (hasNull) {
        keys[size - 1] = RolapUtil.sqlNullValue;
    }
    return keys;
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:15,代码来源:SegmentAxis.java

示例3: getValuesAndIndicator

import mondrian.rolap.RolapUtil; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked"})
public Pair<SortedSet<Comparable>, Boolean> getValuesAndIndicator() {
    if (keys.length > 0
        && keys[keys.length - 1] == RolapUtil.sqlNullValue)
    {
        return (Pair) Pair.of(
            new ArraySortedSet(keys, 0, keys.length - 1),
            Boolean.TRUE);
    } else {
        return (Pair) Pair.of(
            new ArraySortedSet(keys),
            Boolean.FALSE);
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:15,代码来源:SegmentAxis.java

示例4: toSql

import mondrian.rolap.RolapUtil; //导入方法依赖的package包/类
public void toSql(SqlQuery sqlQuery, StringBuilder buf) {
    final RolapStar.Column column = getConstrainedColumn();
    String expr = column.generateExprString(sqlQuery);
    buf.append(expr);
    Object key = getValue();
    if (key == RolapUtil.sqlNullValue) {
        buf.append(" is null");
    } else {
        buf.append(" = ");
        sqlQuery.getDialect().quote(buf, key, column.getDatatype());
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:13,代码来源:ValueColumnPredicate.java

示例5: checkInList

import mondrian.rolap.RolapUtil; //导入方法依赖的package包/类
public BitKey checkInList(SqlQuery sqlQuery, BitKey inListLHSBitKey) {
    // AND predicate by itself is not using IN list; when it is
    // one of the children to an OR predicate, then using IN list
    // is helpful. The later is checked by passing in a bitmap that
    // represent the LHS or the IN list, i.e. the columns that are
    // constrained by the OR.

    // If the child predicates contains null values, those predicates cannot
    // be translated as IN list; however, the rest of the child predicates
    // might still be translated to IN.  For example, neither of the two AND
    // conditions below(part of an OR list) can be translated using IN list,
    // covering all the levels
    //
    //  (null, null, San Francisco)
    //  (null, null, New York)
    //
    // However, after extracting the null part, they can be translated to:
    //
    // (country is null AND state is null AND city IN ("San Fancisco", "New
    // York"))
    //
    // which is still more compact than the default AND/OR translation:
    //
    // (country is null AND state is null AND city = "San Francisco") OR
    // (country is null AND state is null AND city = "New York")
    //
    // This method will mark all the columns that can be translated as part
    // of IN list, so that similar predicates can be grouped together to
    // form partial IN list sql. By default, all columns constrained by this
    // predicates can be part of an IN list.
    //
    // This is very similar to the logic in
    // SqlConstraintUtil.generateMultiValueInExpr().  The only difference
    // being that the predicates here are all "flattened" so the hierarchy
    // information is no longer available to guide the grouping of
    // predicates with common parents. So some optimization possible in
    // generateMultiValueInExpr() is not tried here, as they require
    // implementing "longest common prefix" algorithm which is an overkill.
    BitKey inListRHSBitKey = inListLHSBitKey.copy();

    if (!columnBitKey.equals(inListLHSBitKey)
        || (children.size() > 1
         && !sqlQuery.getDialect().supportsMultiValueInExpr()))
    {
        inListRHSBitKey.clear();
    } else {
        for (StarPredicate predicate : children) {
            // If any predicate requires comparison to null value, cannot
            // use IN list for this predicate.
            if (predicate instanceof ValueColumnPredicate) {
                ValueColumnPredicate columnPred =
                    ((ValueColumnPredicate) predicate);
                if (columnPred.getValue() == RolapUtil.sqlNullValue) {
                    // This column predicate cannot be translated to IN
                    inListRHSBitKey.clear(
                        columnPred.getConstrainedColumn().getBitPosition());
                }
                // else do nothing because this column predicate can be
                // translated to IN
            } else {
                inListRHSBitKey.clear();
                break;
            }
        }
    }
    return inListRHSBitKey;
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:68,代码来源:AndPredicate.java


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