VoltXMLElement voltGetColumnXML(Session session)
            throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException
    {
        VoltXMLElement column = new VoltXMLElement("column");

        // output column metadata
        column.attributes.put("name", columnName.name);
        String typestring = Types.getTypeName(dataType.typeCode);
        column.attributes.put("valuetype", typestring);
        column.attributes.put("nullable", String.valueOf(isNullable()));
        column.attributes.put("size", String.valueOf(dataType.precision));

        if (dataType.precision > 1048576) {
            String msg = typestring + " column size for column ";
            msg += getTableNameString() + "." + columnName.name;
            msg += " is > 1048576 char maximum.";
            throw new org.hsqldb_voltpatches.HSQLInterface.HSQLParseException(msg);
        }

        if (typestring.compareTo("VARCHAR") == 0) {
            assert(dataType instanceof CharacterType);
            CharacterType ct = (CharacterType)dataType;
            column.attributes.put("bytes", String.valueOf(ct.inBytes));
        }

        // see if there is a default value for the column
        Expression exp = getDefaultExpression();

        // if there is a default value for the column
        // and the column value is not NULL. (Ignore "DEFAULT NULL" in DDL)
        if (exp != null) {
            if (exp.valueData != null || (exp instanceof FunctionSQL && ((FunctionSQL)exp).isValueFunction)) {
                exp.dataType = dataType;

                // add default value to body of column element
                VoltXMLElement defaultElem = new VoltXMLElement("default");
                column.children.add(defaultElem);
                defaultElem.children.add(exp.voltGetXML(session));
            }
        }

        return column;
    }
VoltXMLElement voltGetColumnXML ( Session session ) throws org . hsqldb_voltpatches . HSQLInterface . HSQLParseException { VoltXMLElement column = new VoltXMLElement ( "column" ) ; column . attributes . put ( "name" , columnName . name ) ; String typestring = Types . getTypeName ( dataType . typeCode ) ; column . attributes . put ( "valuetype" , typestring ) ; column . attributes . put ( "nullable" , String . valueOf ( isNullable ( ) ) ) ; column . attributes . put ( "size" , String . valueOf ( dataType . precision ) ) ; if ( dataType . precision > 1048576 ) { String msg = typestring + " column size for column " ; msg += getTableNameString ( ) + "." + columnName . name ; msg += " is > 1048576 char maximum." ; throw new org . hsqldb_voltpatches . HSQLInterface . HSQLParseException ( msg ) ; } if ( typestring . compareTo ( "VARCHAR" ) == 0 ) { assert ( dataType instanceof CharacterType ) ; CharacterType ct = ( CharacterType ) dataType ; column . attributes . put ( "bytes" , String . valueOf ( ct . inBytes ) ) ; } Expression exp = getDefaultExpression ( ) ; if ( exp != null ) { if ( exp . valueData != null || ( exp instanceof FunctionSQL && ( ( FunctionSQL ) exp ) . isValueFunction ) ) { exp . dataType = dataType ; VoltXMLElement defaultElem = new VoltXMLElement ( "default" ) ; column . children . add ( defaultElem ) ; defaultElem . children . add ( exp . voltGetXML ( session ) ) ; } } return column ; }
VoltDB added method to get a non-catalog-dependent
representation of this HSQLDB object.
@param session The current Session object may be needed to resolve
some names.
@return XML, correctly indented, representing this object.
@throws HSQLParseException