Package com.foundationdb.server.rowdata

Examples of com.foundationdb.server.rowdata.RowDataValueSource


    @Override
    public ValueSource uncheckedValue(int i) {
        FieldDef fieldDef = rowDef().getFieldDef(i);
        RowData rowData = rowData();
        RowDataValueSource valueSource = ValueSource(i);
        valueSource.bind(fieldDef, rowData);
        return valueSource;
    }
View Full Code Here


        if (valueSources == null) {
            valueSources = new SparseArray<RowDataValueSource>()
            {
                @Override
                protected RowDataValueSource initialValue() {
                    return new RowDataValueSource();
                }
            };
        }
        return valueSources.get(i);
    }
View Full Code Here

        if (row == null) {
            return selfReference;
        }
        if (foreignKey.getReferencedTable() == foreignKey.getReferencingTable()) {
            selfReference = true;
            RowDataValueSource parent = new RowDataValueSource();
            RowDataValueSource child = new RowDataValueSource();

            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);
View Full Code Here

        if (row == null) {
            // This is the truncate case, find all non-null referencing index entries.
            key.append(null);
            return false;
        }
        RowDataValueSource source = new RowDataValueSource();
        PersistitKeyValueTarget target = new PersistitKeyValueTarget(ConstraintHandler.class.getSimpleName());
        target.attach(key);
        boolean anyNull = false;
        for (Column column : columns) {
            source.bind(column.getFieldDef(), row);
            if (source.isNull()) {
                target.putNull();
                anyNull = true;
            }
            else {
                source.getType().writeCollating(source, target);
            }
        }
        return anyNull;
    }
View Full Code Here

        }
        return false;
    }

    public static String formatKey(Session session, RowData row, List<Column> columns) {
        RowDataValueSource source = new RowDataValueSource();
        StringBuilder str = new StringBuilder();
        AkibanAppender appender = AkibanAppender.of(str);
        for (int i = 0; i < columns.size(); i++) {
            if (i > 0) {
                str.append(" and ");
            }
            Column column = columns.get(i);
            str.append(column.getName()).append(" = ");
            source.bind(column.getFieldDef(), row);
            source.getType().format(source, appender);
        }
        return str.toString();
    }
View Full Code Here

        QueryContext context =
            new SimpleQueryContext(store.createAdapter(session, plan.schema),
                                   serviceManager);
        QueryBindings bindings = context.createBindings();
        if (plan.bindOldRow) {
            RowDataValueSource source = new RowDataValueSource();
            for (int i = 0; i < plan.ncols; i++) {
                source.bind(plan.referencedFields[i], oldRow);
                bindings.setValue(i, source);
            }
        }
        if (plan.bindNewRow) {
            RowDataValueSource source = new RowDataValueSource();
            for (int i = 0; i < plan.ncols; i++) {
                source.bind(plan.referencedFields[i], newRow);
                bindings.setValue(plan.referencedFields.length + i, source);
            }
        }
        else if (plan.bindValues != null) {
            for (int i = 0; i < plan.ncols; i++) {
View Full Code Here

        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        Cursor cursor = API.cursor(plan, queryContext, queryBindings);

        List<Column> lookupCols = table.getPrimaryKeyIncludingInternal().getColumns();
        RowDataValueSource pSource = new RowDataValueSource();
        for(int i = 0; i < lookupCols.size(); ++i) {
            Column col = lookupCols.get(i);
            pSource.bind(col.getFieldDef(), rowData);
            queryBindings.setValue(i, pSource);
        }
        try {
            Row row;
            cursor.openTopLevel();
View Full Code Here

TOP

Related Classes of com.foundationdb.server.rowdata.RowDataValueSource

Copyright © 2018 www.massapicom. 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.