Examples of TKeyComparable


Examples of com.foundationdb.server.types.TKeyComparable

                } else if (!this.values.get(columnIndex).hasAnyValue()) {
                    return -1;
                } else {
                    ValueSource left = this.values.get(columnIndex);
                    ValueSource right = that.values.get(columnIndex);
                    TKeyComparable compare = registry.getKeyComparable(this.values.get(columnIndex).getType().typeClass(),
                            that.values.get(columnIndex).getType().typeClass());
                    if (compare != null) {
                        cmp =  compare.getComparison().compare(left.getType(), left, right.getType(), right);
                    } else {
                        cmp = TClass.compare(left.getType(), left, right.getType(), right);
                    }
                    if (cmp != 0) {
                        return cmp;
View Full Code Here

Examples of com.foundationdb.server.types.TKeyComparable

        }
    }

    private void copyValue (ValueSource valueSource, Value valueTarget) {
        if (valueSource.hasAnyValue()) {
            TKeyComparable compare = registry.getKeyComparable(valueSource.getType().typeClass(), valueTarget.getType().typeClass());
            if (compare != null) {
                compare.getComparison().copyComparables(valueSource, valueTarget);
            } else {
                ValueTargets.copyFrom(valueSource, valueTarget);
            }
        }       
    }
View Full Code Here

Examples of com.foundationdb.server.types.TKeyComparable

        IndexBound yTwoBound = new IndexBound(testRow(mdIndex, "y", "two", null, null), new SetColumnSelector(0, 1));
        Operator yTwoScan = API.indexScan_Default(mdIndex,
                                                  false,
                                                  IndexKeyRange.bounded(mdIndex, yTwoBound, true, yTwoBound, true));

        TKeyComparable comparableIntBigint = typesRegistryService().getKeyComparable(
            ais.getTable(mid).getColumn("report_id").getType().typeClass(),
            ais.getTable(rid).getColumn("id").getType().typeClass()
        );

        Operator innerIntersect = API.intersect_Ordered(
                xOneScan,
                fooScan,
                mdIndex,
                rIndex,
                mdIndex.index().getAllColumns().size() - 2,
                rIndex.index().getAllColumns().size() - 1,
                new boolean[]{true},
                JoinType.INNER_JOIN,
                EnumSet.of(IntersectOption.OUTPUT_LEFT, IntersectOption.SKIP_SCAN),
                Arrays.asList(comparableIntBigint.getComparison()),
                true
        );

        Operator outerIntersect = API.intersect_Ordered(
                innerIntersect,
View Full Code Here

Examples of com.foundationdb.server.types.TKeyComparable

            ExpressionNode left = expression.getLeft();
            ExpressionNode right = expression.getRight();
            TInstance leftTInst = type(left);
            TInstance rightTInst = type(right);
            boolean nullable = isNullable(left) || isNullable(right);
            TKeyComparable keyComparable = registry.getKeyComparable(tclass(leftTInst), tclass(rightTInst));
            if (keyComparable != null) {
                expression.setKeyComparable(keyComparable);
            }
            else if (TClass.comparisonNeedsCasting(leftTInst, rightTInst)) {
                boolean needCasts = true;
View Full Code Here

Examples of com.foundationdb.server.types.TKeyComparable

    private TPreparedExpression variable(ParameterExpression expression) {
        return new TPreparedParameter(expression.getPosition(), expression.getType());
    }

    private TPreparedExpression compare(TPreparedExpression left, ComparisonCondition comparison, TPreparedExpression right) {
        TKeyComparable keyComparable = comparison.getKeyComparable();
        if (keyComparable != null) {
            return new TKeyComparisonPreparation(left, comparison.getOperation(), right, comparison.getKeyComparable());
        }
        else {
            return new TComparisonExpression(left, comparison.getOperation(), right);
View Full Code Here

Examples of com.foundationdb.server.types.TKeyComparable

            for (TClass inner : candidates) {
                if (inner == outer)
                    continue;
                Set<TClass> pair = new HashSet<>(Arrays.asList(inner, outer));
                if (alreadyCreated.add(pair)) {
                    results.add(new TKeyComparable(outer, inner, integerComparison));
                }
            }
        }
        return results.toArray(new TKeyComparable[results.size()]);
    }
View Full Code Here

Examples of com.foundationdb.server.types.TKeyComparable

            for (JoinColumn join : foreignKey.getJoinColumns()) {
                parent.bind(join.getParent().getFieldDef(), row);
                child.bind(join.getChild().getFieldDef(), row);
                TInstance pInst = parent.getType();
                TInstance cInst = child.getType();
                TKeyComparable comparable = typesRegistryService.getKeyComparable(pInst.typeClass(), cInst.typeClass());
                int c = (comparable != null) ?
                    comparable.getComparison().compare(pInst, parent, cInst, child) :
                    TClass.compare(pInst, parent, cInst, child);
                selfReference &= (c == 0);
            }
        }
        return selfReference;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.