D_Reference_Stream_Table.java [src/java/svap/utils] Revision: default  Date:
package svap.utils;

import csip.ServiceException;
import data.table.column.ColumnDate;
import data.table.column.ColumnGeometry;
import java.sql.Connection;
import data.table.column.ColumnInteger;
import data.table.column.ColumnString;
import java.time.LocalDate;
import sql.table.SQLTable;
import utils.TableException;

/**
 *
 * @author Rumpal
 */
public class D_Reference_Stream_Table extends SQLTable {

    public static final String ID = "id";
    public static final String NAME = "name";
    public static final String DESCRIPTION = "description";
    public static final String LAST_UPDATE = "last_update";
    public static final String EXPIRED_DATE = "expired_date";
    public static final String LOCATION = "location";

    public D_Reference_Stream_Table(Connection conn) {
        super(conn);

        schemaName = "svap";
        tableName = "d_reference_stream";

        addDataColumn(ID, new ColumnInteger(ID, "Add description here."));
        addDataColumn(NAME, new ColumnString(NAME, "Add description here."));
        addDataColumn(DESCRIPTION, new ColumnString(DESCRIPTION, "Add description here."));
        addDataColumn(LAST_UPDATE, new ColumnDate(LAST_UPDATE, "Add description here."));
        addDataColumn(EXPIRED_DATE, new ColumnDate(EXPIRED_DATE, "Add description here."));
        addDataColumn(LOCATION, new ColumnGeometry(LOCATION, "Add description here."));

//        primaryKeys.add(ID);

        outputOrderList.add(ID);
        outputOrderList.add(NAME);
        outputOrderList.add(DESCRIPTION);
        outputOrderList.add(LAST_UPDATE);
        outputOrderList.add(EXPIRED_DATE);
        outputOrderList.add(LOCATION);

        for (String key : columns.keySet()) {
            columns.get(key).setIncludeInOutput(true);
        }
    }

    public int id() throws TableException, ServiceException {
        return getInteger(ID);
    }

    public void id(int value) throws TableException, ServiceException {
        setInteger(ID, value);
    }

    public String name() throws TableException, ServiceException {
        return getString(NAME);
    }

    public void name(String value) throws TableException, ServiceException {
        setString(NAME, value);
    }

    public String description() throws TableException, ServiceException {
        return getString(DESCRIPTION);
    }

    public void description(String value) throws TableException, ServiceException {
        setString(DESCRIPTION, value);
    }

    public LocalDate last_update() throws TableException, ServiceException {
        return getDate(LAST_UPDATE);
    }

    public void last_update(LocalDate value) throws TableException, ServiceException {
        setDate(LAST_UPDATE, value);
    }

    public LocalDate expired_date() throws TableException, ServiceException {
        return getDate(EXPIRED_DATE);
    }

    public void expired_date(LocalDate value) throws TableException, ServiceException {
        setDate(EXPIRED_DATE, value);
    }

}