/*
 * This file is generated by jOOQ.
 */
package ervu_dashboard.ervu_dashboard.db_beans.public_.tables;


import ervu_dashboard.ervu_dashboard.db_beans.public_.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.public_.Public;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.Citizen.CitizenPath;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.records.ReasonRegistrationRecord;

import java.util.Collection;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.InverseForeignKey;
import org.jooq.Name;
import org.jooq.Path;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.Record;
import org.jooq.SQL;
import org.jooq.Schema;
import org.jooq.Select;
import org.jooq.Stringly;
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 ReasonRegistration extends TableImpl<ReasonRegistrationRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.reason_registration</code>
     */
    public static final ReasonRegistration REASON_REGISTRATION = new ReasonRegistration();

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

    /**
     * The column
     * <code>public.reason_registration.reason_registration_id</code>.
     */
    public final TableField<ReasonRegistrationRecord, Long> REASON_REGISTRATION_ID = createField(DSL.name("reason_registration_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>public.reason_registration.code</code>.
     */
    public final TableField<ReasonRegistrationRecord, Integer> CODE = createField(DSL.name("code"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>public.reason_registration.name</code>.
     */
    public final TableField<ReasonRegistrationRecord, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR.nullable(false), this, "");

    private ReasonRegistration(Name alias, Table<ReasonRegistrationRecord> aliased) {
        this(alias, aliased, (Field<?>[]) null, null);
    }

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

    /**
     * Create an aliased <code>public.reason_registration</code> table reference
     */
    public ReasonRegistration(String alias) {
        this(DSL.name(alias), REASON_REGISTRATION);
    }

    /**
     * Create an aliased <code>public.reason_registration</code> table reference
     */
    public ReasonRegistration(Name alias) {
        this(alias, REASON_REGISTRATION);
    }

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

    public <O extends Record> ReasonRegistration(Table<O> path, ForeignKey<O, ReasonRegistrationRecord> childPath, InverseForeignKey<O, ReasonRegistrationRecord> parentPath) {
        super(path, childPath, parentPath, REASON_REGISTRATION);
    }

    /**
     * A subtype implementing {@link Path} for simplified path-based joins.
     */
    public static class ReasonRegistrationPath extends ReasonRegistration implements Path<ReasonRegistrationRecord> {
        public <O extends Record> ReasonRegistrationPath(Table<O> path, ForeignKey<O, ReasonRegistrationRecord> childPath, InverseForeignKey<O, ReasonRegistrationRecord> parentPath) {
            super(path, childPath, parentPath);
        }
        private ReasonRegistrationPath(Name alias, Table<ReasonRegistrationRecord> aliased) {
            super(alias, aliased);
        }

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

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

        @Override
        public ReasonRegistrationPath as(Table<?> alias) {
            return new ReasonRegistrationPath(alias.getQualifiedName(), this);
        }
    }

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

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

    @Override
    public UniqueKey<ReasonRegistrationRecord> getPrimaryKey() {
        return Keys.REASON_REGISTRATION_PKEY;
    }

    private transient CitizenPath _citizen;

    /**
     * Get the implicit to-many join path to the <code>public.citizen</code>
     * table
     */
    public CitizenPath citizen() {
        if (_citizen == null)
            _citizen = new CitizenPath(this, null, Keys.CITIZEN__P_CITIZEN_FK6.getInverseKey());

        return _citizen;
    }

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

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

    @Override
    public ReasonRegistration as(Table<?> alias) {
        return new ReasonRegistration(alias.getQualifiedName(), this);
    }

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

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

    /**
     * Rename this table
     */
    @Override
    public ReasonRegistration rename(Table<?> name) {
        return new ReasonRegistration(name.getQualifiedName(), null);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonRegistration where(Condition condition) {
        return new ReasonRegistration(getQualifiedName(), aliased() ? this : null, null, condition);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonRegistration where(Collection<? extends Condition> conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonRegistration where(Condition... conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonRegistration where(Field<Boolean> condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ReasonRegistration where(SQL condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ReasonRegistration where(@Stringly.SQL String condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ReasonRegistration where(@Stringly.SQL String condition, Object... binds) {
        return where(DSL.condition(condition, binds));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ReasonRegistration where(@Stringly.SQL String condition, QueryPart... parts) {
        return where(DSL.condition(condition, parts));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonRegistration whereExists(Select<?> select) {
        return where(DSL.exists(select));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonRegistration whereNotExists(Select<?> select) {
        return where(DSL.notExists(select));
    }
}
