Package org.lealone.value

Examples of org.lealone.value.CompareMode


            v = column.convert(v);
            valueSet.add(v);
        }
        Value[] array = new Value[valueSet.size()];
        valueSet.toArray(array);
        final CompareMode mode = session.getDatabase().getCompareMode();
        Arrays.sort(array, new Comparator<Value>() {
            public int compare(Value o1, Value o2) {
                return o1.compareTo(o2, mode);
            }
        });
View Full Code Here


            for (Value dv : distinctValues.keys()) {
                AggregateData d = distinctValues.get(dv);
                values[i] = ValueArray.get(new Value[] { dv, ValueLong.get(d.count) });
                i++;
            }
            final CompareMode compareMode = database.getCompareMode();
            Arrays.sort(values, new Comparator<ValueArray>() {
                public int compare(ValueArray v1, ValueArray v2) {
                    Value a1 = v1.getList()[0];
                    Value a2 = v2.getList()[0];
                    return a1.compareTo(a2, compareMode);
View Full Code Here

            for (Value dv : distinctValues.keys()) {
                AggregateData d = distinctValues.get(dv);
                values[i] = ValueArray.get(new Value[] { dv, ValueLong.get(d.count) });
                i++;
            }
            final CompareMode compareMode = database.getCompareMode();
            Arrays.sort(values, new Comparator<ValueArray>() {
                public int compare(ValueArray v1, ValueArray v2) {
                    Value a1 = v1.getList()[0];
                    Value a2 = v2.getList()[0];
                    return a1.compareTo(a2, compareMode);
View Full Code Here

    }

    private void patchCurrentRow(Value[] row) {
        boolean changed = false;
        Value[] current = result.currentRow();
        CompareMode mode = conn.getCompareMode();
        for (int i = 0; i < row.length; i++) {
            if (row[i].compareTo(current[i], mode) != 0) {
                changed = true;
                break;
            }
View Full Code Here

            Table table = database.getFirstUserTable();
            if (table != null) {
                throw DbException.get(ErrorCode.COLLATION_CHANGE_WITH_DATA_TABLE_1, table.getSQL());
            }
            final boolean binaryUnsigned = database.getCompareMode().isBinaryUnsigned();
            CompareMode compareMode;
            StringBuilder buff = new StringBuilder(stringValue);
            if (stringValue.equals(CompareMode.OFF)) {
                compareMode = CompareMode.getInstance(null, 0, binaryUnsigned);
            } else {
                int strength = getIntValue();
                buff.append(" STRENGTH ");
                if (strength == Collator.IDENTICAL) {
                    buff.append("IDENTICAL");
                } else if (strength == Collator.PRIMARY) {
                    buff.append("PRIMARY");
                } else if (strength == Collator.SECONDARY) {
                    buff.append("SECONDARY");
                } else if (strength == Collator.TERTIARY) {
                    buff.append("TERTIARY");
                }
                compareMode = CompareMode.getInstance(stringValue, strength, binaryUnsigned);
            }
            addOrUpdateSetting(name, buff.toString(), 0);
            database.setCompareMode(compareMode);
            break;
        }
        case SetTypes.BINARY_COLLATION: {
            session.getUser().checkAdmin();
            Table table = database.getFirstUserTable();
            if (table != null) {
                throw DbException.get(ErrorCode.COLLATION_CHANGE_WITH_DATA_TABLE_1, table.getSQL());
            }
            CompareMode currentMode = database.getCompareMode();
            CompareMode newMode;
            if (stringValue.equals(CompareMode.SIGNED)) {
                newMode = CompareMode.getInstance(currentMode.getName(), currentMode.getStrength(), false);
            } else if (stringValue.equals(CompareMode.UNSIGNED)) {
                newMode = CompareMode.getInstance(currentMode.getName(), currentMode.getStrength(), true);
            } else {
View Full Code Here

TOP

Related Classes of org.lealone.value.CompareMode

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.