Package org.hsqldb.types

Examples of org.hsqldb.types.CharacterType


     */
    private Type translateType(Type type) {

        if (this.translateDTIType) {
            if (type.isIntervalType()) {
                type = new CharacterType(Types.SQL_VARCHAR,
                        type.displaySize());
            } else if (type.isDateTimeTypeWithZone()) {
                type = ((DateTimeType) type).getDateTimeTypeWithoutZone();
            }
        }
View Full Code Here


     */
    private Type translateType(Type type) {

        if (this.translateDTIType) {
            if (type.isIntervalType()) {
                type = new CharacterType(Types.SQL_VARCHAR,
                        type.displaySize());
            } else if (type.isDateTimeTypeWithZone()) {
                type = ((DateTimeType) type).getDateTimeTypeWithoutZone();
            }
        }
View Full Code Here

                    if (value == null) {
                        return null;
                    }

                    CharacterType type = (CharacterType) nodes[RIGHT].dataType;
                    long length =
                        ((CharacterType) nodes[RIGHT].dataType).size(session,
                            value);

                    type  = (CharacterType) nodes[LEFT].dataType;
                    value = nodes[LEFT].getValue(session);

                    if (value == null) {
                        return null;
                    }

                    return type.substring(session, value, 0, length, true,
                                          false);
                } else {
                    BinaryData value =
                        (BinaryData) nodes[RIGHT].getValue(session);

                    if (value == null) {
                        return null;
                    }

                    long       length = value.length(session);
                    BinaryType type   = (BinaryType) nodes[LEFT].dataType;

                    value = (BinaryData) nodes[LEFT].getValue(session);

                    if (value == null) {
                        return null;
                    }

                    return type.substring(session, value, 0, length, true);
                }
            }
            case OpTypes.CAST : {
                Object value =
                    dataType.castToType(session,
View Full Code Here

                return nodes[LEFT].getValue(session);

            case OpTypes.PREFIX : {
                if (nodes[LEFT].dataType.isCharacterType()) {
                    Object        value = nodes[RIGHT].getValue(session);
                    CharacterType type = (CharacterType) nodes[RIGHT].dataType;
                    long length =
                        ((CharacterType) nodes[RIGHT].dataType).size(session,
                            value);

                    type  = (CharacterType) nodes[LEFT].dataType;
                    value = nodes[LEFT].getValue(session);

                    return type.substring(session, value, 0, length, true,
                                          false);
                } else {
                    BinaryData value =
                        (BinaryData) nodes[RIGHT].getValue(session);
                    long       length = value.length(session);
                    BinaryType type   = (BinaryType) nodes[LEFT].dataType;

                    value = (BinaryData) nodes[LEFT].getValue(session);

                    return type.substring(session, value, 0, length, true);
                }
            }
            case OpTypes.CAST : {
                Object value =
                    dataType.castToType(session,
View Full Code Here

TOP

Related Classes of org.hsqldb.types.CharacterType

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.