view src/main/java/nl/cwi/monetdb/embedded/tables/MonetDBTableColumn.java @ 48:8353929359d6 embedded

Starting to test Java to BAT conversion. Let the debugging games begin!
author Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
date Fri, 11 Nov 2016 18:10:44 +0100 (2016-11-11)
parents dfea8468cd1a
children c592d8a72627
line wrap: on
line source
package nl.cwi.monetdb.embedded.tables;

import nl.cwi.monetdb.embedded.mapping.AbstractColumn;

/**
 * Java representation of a MonetDB table column.
 *
 * @author <a href="mailto:pedro.ferreira@monetdbsolutions.com">Pedro Ferreira</a>
 */
public class MonetDBTableColumn<T> extends AbstractColumn<T> {

    /**
     * A String representation of the default value if exists, otherwise is null.
     */
    private final String defaultValue;

    /**
     * A boolean indication if the column is nullable.
     */
    private final boolean isNullable;

    /**
     * Internal MonetDB index of the column.
     */
    private final int internalMonetDBTypeIndex;

    public MonetDBTableColumn(int resultSetIndex, String columnName, String columnType, int columnDigits,
                              int columnScale, String defaultValue, boolean isNullable, int internalMonetDBTypeIndex) {
        super(resultSetIndex, columnName, columnType, columnDigits, columnScale);
        this.defaultValue = defaultValue;
        this.isNullable = isNullable;
        this.internalMonetDBTypeIndex = internalMonetDBTypeIndex;
    }

    /**
     * Get the default value if there is one, or null if none.
     *
     * @return The default value if there is one, or null if none
     */
    public String getDefaultValue() { return defaultValue; }

    /**
     * Get the indication if the column is nullable.
     *
     * @return The indication if the column is nullable
     */
    public boolean isNullable() { return isNullable; }

    protected int getInternalMonetDBTypeIndex() { return internalMonetDBTypeIndex; }
}