/*
 * This file is generated by jOOQ.
 */
package io.github.quickmsg.persistent.tables.tables;


import io.github.quickmsg.persistent.tables.Indexes;
import io.github.quickmsg.persistent.tables.Smqtt;
import io.github.quickmsg.persistent.tables.tables.records.SmqttRetainRecord;

import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row5;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
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 SmqttRetain extends TableImpl<SmqttRetainRecord> {

    private static final long serialVersionUID = 1L;


    public static final SmqttRetain SMQTT_RETAIN = new SmqttRetain();


    @Override
    public Class<SmqttRetainRecord> getRecordType() {
        return SmqttRetainRecord.class;
    }

    public final TableField<SmqttRetainRecord, String> TOPIC = createField(DSL.name("topic"), SQLDataType.VARCHAR(255).defaultValue(DSL.inline("NULL", SQLDataType.VARCHAR)), this, "话题");

    public final TableField<SmqttRetainRecord, Integer> QOS = createField(DSL.name("qos"), SQLDataType.INTEGER.defaultValue(DSL.inline("NULL", SQLDataType.INTEGER)), this, "qos");


    public final TableField<SmqttRetainRecord, String> BODY = createField(DSL.name("body"), SQLDataType.VARCHAR(255).defaultValue(DSL.inline("NULL", SQLDataType.VARCHAR)), this, "消息内容");


    public final TableField<SmqttRetainRecord, LocalDateTime> CREATE_TIME = createField(DSL.name("create_time"), SQLDataType.LOCALDATETIME(0).defaultValue(DSL.inline("NULL", SQLDataType.LOCALDATETIME)), this, "记录保存时间");


    public final TableField<SmqttRetainRecord, LocalDateTime> UPDATE_TIME = createField(DSL.name("update_time"), SQLDataType.LOCALDATETIME(0).defaultValue(DSL.inline("NULL", SQLDataType.LOCALDATETIME)), this, "记录更新时间");

    private SmqttRetain(Name alias, Table<SmqttRetainRecord> aliased) {
        this(alias, aliased, null);
    }

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


    public SmqttRetain(String alias) {
        this(DSL.name(alias), SMQTT_RETAIN);
    }


    public SmqttRetain(Name alias) {
        this(alias, SMQTT_RETAIN);
    }


    public SmqttRetain() {
        this(DSL.name("smqtt_retain"), null);
    }

    public <O extends Record> SmqttRetain(Table<O> child, ForeignKey<O, SmqttRetainRecord> key) {
        super(child, key, SMQTT_RETAIN);
    }

    @Override
    public Schema getSchema() {
        return Smqtt.SMQTT;
    }

    @Override
    public List<Index> getIndexes() {
        return Arrays.<Index>asList(Indexes.SMQTT_RETAIN_INDEX_TOPIC);
    }

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

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


    @Override
    public SmqttRetain rename(String name) {
        return new SmqttRetain(DSL.name(name), null);
    }


    @Override
    public SmqttRetain rename(Name name) {
        return new SmqttRetain(name, null);
    }

    // -------------------------------------------------------------------------
    // Row5 type methods
    // -------------------------------------------------------------------------

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