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

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 Employment extends TableImpl<EmploymentRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.employment</code>
     */
    public static final Employment EMPLOYMENT = new Employment();

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

    /**
     * The column <code>public.employment.employment_id</code>.
     */
    public final TableField<EmploymentRecord, Long> EMPLOYMENT_ID = createField(DSL.name("employment_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

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

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

    /**
     * Create an aliased <code>public.employment</code> table reference
     */
    public Employment(String alias) {
        this(DSL.name(alias), EMPLOYMENT);
    }

    /**
     * Create an aliased <code>public.employment</code> table reference
     */
    public Employment(Name alias) {
        this(alias, EMPLOYMENT);
    }

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

    public <O extends Record> Employment(Table<O> path, ForeignKey<O, EmploymentRecord> childPath, InverseForeignKey<O, EmploymentRecord> parentPath) {
        super(path, childPath, parentPath, EMPLOYMENT);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<EmploymentRecord> getPrimaryKey() {
        return Keys.EMPLOYMENT_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_FK4.getInverseKey());

        return _citizen;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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