/*
 * 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.MaritalStatus.MaritalStatusPath;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.records.GenderRecord;

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 Gender extends TableImpl<GenderRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.gender</code>
     */
    public static final Gender GENDER = new Gender();

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

    /**
     * The column <code>public.gender.gender_id</code>.
     */
    public final TableField<GenderRecord, Long> GENDER_ID = createField(DSL.name("gender_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

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

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

    /**
     * Create an aliased <code>public.gender</code> table reference
     */
    public Gender(String alias) {
        this(DSL.name(alias), GENDER);
    }

    /**
     * Create an aliased <code>public.gender</code> table reference
     */
    public Gender(Name alias) {
        this(alias, GENDER);
    }

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

    public <O extends Record> Gender(Table<O> path, ForeignKey<O, GenderRecord> childPath, InverseForeignKey<O, GenderRecord> parentPath) {
        super(path, childPath, parentPath, GENDER);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<GenderRecord> getPrimaryKey() {
        return Keys.GENDER_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_FK2.getInverseKey());

        return _citizen;
    }

    private transient MaritalStatusPath _maritalStatus;

    /**
     * Get the implicit to-many join path to the
     * <code>public.marital_status</code> table
     */
    public MaritalStatusPath maritalStatus() {
        if (_maritalStatus == null)
            _maritalStatus = new MaritalStatusPath(this, null, Keys.MARITAL_STATUS__MARITAL_STATUS_FK1.getInverseKey());

        return _maritalStatus;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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