/*
 * 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.EducationRecord;

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 Education extends TableImpl<EducationRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.education</code>
     */
    public static final Education EDUCATION = new Education();

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

    /**
     * The column <code>public.education.education_id</code>.
     */
    public final TableField<EducationRecord, Long> EDUCATION_ID = createField(DSL.name("education_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

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

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

    /**
     * Create an aliased <code>public.education</code> table reference
     */
    public Education(String alias) {
        this(DSL.name(alias), EDUCATION);
    }

    /**
     * Create an aliased <code>public.education</code> table reference
     */
    public Education(Name alias) {
        this(alias, EDUCATION);
    }

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

    public <O extends Record> Education(Table<O> path, ForeignKey<O, EducationRecord> childPath, InverseForeignKey<O, EducationRecord> parentPath) {
        super(path, childPath, parentPath, EDUCATION);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<EducationRecord> getPrimaryKey() {
        return Keys.EDUCATION_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_FK5.getInverseKey());

        return _citizen;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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