TableSaSpatialVer.java [src/soils/db/tables] Revision: default  Date:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package soils.db.tables;

import java.util.ArrayList;
import java.util.Arrays;

/**
 *
 * @author scase
 */
public class TableSaSpatialVer extends Table {

    public static final String TABLE_NAME = "saspatialver";

    //Column Names
    public static final String AREASYMBOL_NAME = "areasymbol";
    public static final String SPATIAL_VERSION = "spatialversion";
    public static final String SPATIAL_VERSION_EST = "spatialverest";


    private static final String[] AREASYMBOL = {AREASYMBOL_NAME, "A symbol that uniquely identifies a single occurrence of a particular type of area (e.g. Lancaster Co., Nebraska is NE109)"};
    private static final String[] SPATIAL_VERSION_DATA = {SPATIAL_VERSION, "A sequential integer number used to denote the serial version of the spatial data for a soil survey area."};
    private static final String[] SPATIAL_VERSION_EST_DATA = {SPATIAL_VERSION_EST, "The date and time at which a particular version of soil survey area spatial data was established."};

    /**
     * This ArrayList contains a static list of columns for this table that are
     * required regardless of the calling program's preferences. This columns
     * typically identify indexes and foreign keys and other relational aspects
     * of a table that must be maintained for data integrity.
     *
     * @see Table#getMandatoryColumns()
     * @see #getMandatoryColumns()
     */
    protected static ArrayList<String> MANDATORY_COLUMNS = new ArrayList<String>(Arrays.asList(SPATIAL_VERSION, SPATIAL_VERSION_EST));

    /**
     * Constructor
     */
    public TableSaSpatialVer() {
        tableName = TABLE_NAME;

        addDataColumn(AREASYMBOL_NAME, new TableColumnString(AREASYMBOL));
        addDataColumn(SPATIAL_VERSION, new TableColumnInteger(SPATIAL_VERSION_DATA));
        addDataColumn(SPATIAL_VERSION_EST, new TableColumnString(SPATIAL_VERSION_EST_DATA));
    }

    @Override
    protected ArrayList<String> getMandatoryColumns() {
        return MANDATORY_COLUMNS;
    }

    public String areasymbol() {
        return ((String) columns.get(AREASYMBOL_NAME).getValue());
    }

    /**
     *
     * @param value
     */
    public void areasymbol(String value) {
        columns.get(AREASYMBOL_NAME).setValue(value);
    }

    public int spatialversion() {
        return ((int) columns.get(SPATIAL_VERSION).getValue());
    }

    /**
     *
     * @param value
     */
    public void spatialversion(int value) {
        columns.get(SPATIAL_VERSION).setValue(value);
    }

    public String spatialverest() {
        return ((String) columns.get(SPATIAL_VERSION_EST).getValue());
    }

    /**
     *
     * @param value
     */
    public void spatialverest(String value) {
        columns.get(SPATIAL_VERSION_EST).setValue(value);
    }
}