/*
 * This file is generated by jOOQ.
 */
package com.databasir.dao.tables;


import com.databasir.dao.Databasir;
import com.databasir.dao.Keys;
import com.databasir.dao.tables.records.SysKeyRecord;

import java.time.LocalDateTime;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row6;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class SysKey extends TableImpl<SysKeyRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>databasir.sys_key</code>
     */
    public static final SysKey SYS_KEY = new SysKey();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<SysKeyRecord> getRecordType() {
        return SysKeyRecord.class;
    }

    /**
     * The column <code>databasir.sys_key.id</code>.
     */
    public final TableField<SysKeyRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, "");

    /**
     * The column <code>databasir.sys_key.rsa_public_key</code>.
     */
    public final TableField<SysKeyRecord, String> RSA_PUBLIC_KEY = createField(DSL.name("rsa_public_key"), SQLDataType.CLOB.nullable(false), this, "");

    /**
     * The column <code>databasir.sys_key.rsa_private_key</code>.
     */
    public final TableField<SysKeyRecord, String> RSA_PRIVATE_KEY = createField(DSL.name("rsa_private_key"), SQLDataType.CLOB.nullable(false), this, "");

    /**
     * The column <code>databasir.sys_key.aes_key</code>.
     */
    public final TableField<SysKeyRecord, String> AES_KEY = createField(DSL.name("aes_key"), SQLDataType.CLOB.nullable(false), this, "");

    /**
     * The column <code>databasir.sys_key.update_at</code>.
     */
    public final TableField<SysKeyRecord, LocalDateTime> UPDATE_AT = createField(DSL.name("update_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");

    /**
     * The column <code>databasir.sys_key.create_at</code>.
     */
    public final TableField<SysKeyRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");

    private SysKey(Name alias, Table<SysKeyRecord> aliased) {
        this(alias, aliased, null);
    }

    private SysKey(Name alias, Table<SysKeyRecord> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
    }

    /**
     * Create an aliased <code>databasir.sys_key</code> table reference
     */
    public SysKey(String alias) {
        this(DSL.name(alias), SYS_KEY);
    }

    /**
     * Create an aliased <code>databasir.sys_key</code> table reference
     */
    public SysKey(Name alias) {
        this(alias, SYS_KEY);
    }

    /**
     * Create a <code>databasir.sys_key</code> table reference
     */
    public SysKey() {
        this(DSL.name("sys_key"), null);
    }

    public <O extends Record> SysKey(Table<O> child, ForeignKey<O, SysKeyRecord> key) {
        super(child, key, SYS_KEY);
    }

    @Override
    public Schema getSchema() {
        return aliased() ? null : Databasir.DATABASIR;
    }

    @Override
    public Identity<SysKeyRecord, Integer> getIdentity() {
        return (Identity<SysKeyRecord, Integer>) super.getIdentity();
    }

    @Override
    public UniqueKey<SysKeyRecord> getPrimaryKey() {
        return Keys.KEY_SYS_KEY_PRIMARY;
    }

    @Override
    public SysKey as(String alias) {
        return new SysKey(DSL.name(alias), this);
    }

    @Override
    public SysKey as(Name alias) {
        return new SysKey(alias, this);
    }

    /**
     * Rename this table
     */
    @Override
    public SysKey rename(String name) {
        return new SysKey(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public SysKey rename(Name name) {
        return new SysKey(name, null);
    }

    // -------------------------------------------------------------------------
    // Row6 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row6<Integer, String, String, String, LocalDateTime, LocalDateTime> fieldsRow() {
        return (Row6) super.fieldsRow();
    }
}
