UserIds.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.UserIdsRecord;

import java.util.UUID;
import java.util.function.Function;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Function1;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Records;
import org.jooq.Row1;
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 UserIds extends TableImpl<UserIdsRecord> {

    private static final long serialVersionUID = 1L;

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

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

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

    private UserIds(Name alias, Table<UserIdsRecord> aliased) {
        this(alias, aliased, null);
    }

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

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

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

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

    public <O extends Record> UserIds(Table<O> child, ForeignKey<O, UserIdsRecord> key) {
        super(child, key, USER_IDS);
    }

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

    @Override
    public UniqueKey<UserIdsRecord> getPrimaryKey() {
        return Keys.CONSTRAINT_1;
    }

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

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

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

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

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

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

    // -------------------------------------------------------------------------
    // Row1 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row1<UUID> fieldsRow() {
        return (Row1) super.fieldsRow();
    }

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

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