Users.java

/*
 * This file is generated by jOOQ.
 */
package com.io7m.idstore.database.postgres.internal.tables;


import com.io7m.idstore.database.postgres.internal.DefaultSchema;
import com.io7m.idstore.database.postgres.internal.Keys;
import com.io7m.idstore.database.postgres.internal.tables.records.UsersRecord;

import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.function.Function;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Function10;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Records;
import org.jooq.Row10;
import org.jooq.Schema;
import org.jooq.SelectField;
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 Users extends TableImpl<UsersRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>USERS</code>
     */
    public static final Users USERS = new Users();

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

    /**
     * The column <code>USERS.ID</code>.
     */
    public final TableField<UsersRecord, UUID> ID = createField(DSL.name("ID"), SQLDataType.UUID.nullable(false), this, "");

    /**
     * The column <code>USERS.ID_NAME</code>.
     */
    public final TableField<UsersRecord, String> ID_NAME = createField(DSL.name("ID_NAME"), SQLDataType.VARCHAR(1000000).nullable(false), this, "");

    /**
     * The column <code>USERS.REAL_NAME</code>.
     */
    public final TableField<UsersRecord, String> REAL_NAME = createField(DSL.name("REAL_NAME"), SQLDataType.VARCHAR(1000000).nullable(false), this, "");

    /**
     * The column <code>USERS.TIME_CREATED</code>.
     */
    public final TableField<UsersRecord, OffsetDateTime> TIME_CREATED = createField(DSL.name("TIME_CREATED"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, "");

    /**
     * The column <code>USERS.TIME_UPDATED</code>.
     */
    public final TableField<UsersRecord, OffsetDateTime> TIME_UPDATED = createField(DSL.name("TIME_UPDATED"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, "");

    /**
     * The column <code>USERS.PASSWORD_ALGO</code>.
     */
    public final TableField<UsersRecord, String> PASSWORD_ALGO = createField(DSL.name("PASSWORD_ALGO"), SQLDataType.VARCHAR(1000000).nullable(false), this, "");

    /**
     * The column <code>USERS.PASSWORD_HASH</code>.
     */
    public final TableField<UsersRecord, String> PASSWORD_HASH = createField(DSL.name("PASSWORD_HASH"), SQLDataType.VARCHAR(1000000).nullable(false), this, "");

    /**
     * The column <code>USERS.PASSWORD_SALT</code>.
     */
    public final TableField<UsersRecord, String> PASSWORD_SALT = createField(DSL.name("PASSWORD_SALT"), SQLDataType.VARCHAR(1000000).nullable(false), this, "");

    /**
     * The column <code>USERS.PASSWORD_EXPIRES</code>.
     */
    public final TableField<UsersRecord, OffsetDateTime> PASSWORD_EXPIRES = createField(DSL.name("PASSWORD_EXPIRES"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, "");

    /**
     * The column <code>USERS.DELETING</code>.
     */
    public final TableField<UsersRecord, Boolean> DELETING = createField(DSL.name("DELETING"), SQLDataType.BOOLEAN.nullable(false), this, "");

    private Users(Name alias, Table<UsersRecord> aliased) {
        this(alias, aliased, null);
    }

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

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

    /**
     * Create an aliased <code>USERS</code> table reference
     */
    public Users(Name alias) {
        this(alias, USERS);
    }

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

    public <O extends Record> Users(Table<O> child, ForeignKey<O, UsersRecord> key) {
        super(child, key, USERS);
    }

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

    @Override
    public UniqueKey<UsersRecord> getPrimaryKey() {
        return Keys.CONSTRAINT_4;
    }

    @Override
    public List<UniqueKey<UsersRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.CONSTRAINT_4D);
    }

    @Override
    public List<ForeignKey<UsersRecord, ?>> getReferences() {
        return Arrays.asList(Keys.CONSTRAINT_4D4);
    }

    private transient UserIds _userIds;

    /**
     * Get the implicit join path to the <code>PUBLIC.USER_IDS</code> table.
     */
    public UserIds userIds() {
        if (_userIds == null)
            _userIds = new UserIds(this, Keys.CONSTRAINT_4D4);

        return _userIds;
    }

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

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

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

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

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

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

    // -------------------------------------------------------------------------
    // Row10 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row10<UUID, String, String, OffsetDateTime, OffsetDateTime, String, String, String, OffsetDateTime, Boolean> fieldsRow() {
        return (Row10) super.fieldsRow();
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Function)}.
     */
    public <U> SelectField<U> mapping(Function10<? super UUID, ? super String, ? super String, ? super OffsetDateTime, ? super OffsetDateTime, ? super String, ? super String, ? super String, ? super OffsetDateTime, ? super Boolean, ? extends U> from) {
        return convertFrom(Records.mapping(from));
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Class,
     * Function)}.
     */
    public <U> SelectField<U> mapping(Class<U> toType, Function10<? super UUID, ? super String, ? super String, ? super OffsetDateTime, ? super OffsetDateTime, ? super String, ? super String, ? super String, ? super OffsetDateTime, ? super Boolean, ? extends U> from) {
        return convertFrom(toType, Records.mapping(from));
    }
}