Package com.foundationdb.server.error

Examples of com.foundationdb.server.error.KeyColumnMismatchException


        List<List<Object>> results = new ArrayList<>();
        String[] allPKs = pkList.split(";");
        for(String pk : allPKs) {
            String[] encodedColumns = pk.split(",");
            if(encodedColumns.length != columnCount) {
                throw new KeyColumnMismatchException("Column count mismatch");
            }
            boolean colNameSpecified = false;
            Object[] decodedColumns = new Object[columnCount];
            for(int i = 0; i < columnCount; ++i) {
                IndexColumn keyColumn = keyColumns.get(i);
                String[] pair = encodedColumns[i].split("=");
                final int pos;
                final String value;
                if(pair.length == 1) {
                    pos = i;
                    value = pair[0];
                    if(colNameSpecified) {
                        throw new KeyColumnMismatchException("Can not mix values with key/values");
                    }
                } else if(pair.length == 2) {
                    pos = positionInIndex(primaryKey, pair[0]);
                    value = pair[1];
                    if(i > 0 && !colNameSpecified) {
                        throw new KeyColumnMismatchException("Can not mix values with key/values");
                    }
                    colNameSpecified = true;
                } else {
                    throw new KeyColumnMismatchException ("Malformed column=value pair");
                }
                decodedColumns[pos] = decodeValue(keyColumn, value);
            }
            results.add(Arrays.asList(decodedColumns));
        }
View Full Code Here


        for(IndexColumn iCol : index.getKeyColumns()) {
            if(iCol.getColumn().getName().equals(columnName)) {
                return iCol.getPosition();
            }
        }
        throw new KeyColumnMismatchException ("Column `" + columnName + "` is not a primary key column");
    }
View Full Code Here

                    }
                    else if ("base64".equals(pair[0])) {
                        return new WrappingByteSource(Strings.fromBase64(pair[1]));
                    }
                    else {
                        throw new KeyColumnMismatchException("Malformed encoding:encoded binary value");
                    }
                }
                else {
                    throw new KeyColumnMismatchException("Malformed encoding:encoded binary value");
                }
            }
            else {
                return URLDecoder.decode(value, STRING_ENCODING);
            }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.error.KeyColumnMismatchException

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.