All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yourrents.services.geodata.jooq.tables.Continent Maven / Gradle / Ivy

The newest version!
/*
 * This file is generated by jOOQ.
 */
package com.yourrents.services.geodata.jooq.tables;

/*-
 * #%L
 * YourRents GeoData Service
 * %%
 * Copyright (C) 2023 Your Rents Team
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */


import com.yourrents.services.geodata.jooq.Keys;
import com.yourrents.services.geodata.jooq.YrsGeodata;
import com.yourrents.services.geodata.jooq.tables.records.ContinentRecord;

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.Function4;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Records;
import org.jooq.Row4;
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 Continent extends TableImpl {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of yrs_geodata.continent
     */
    public static final Continent CONTINENT = new Continent();

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

    /**
     * The column yrs_geodata.continent.id.
     */
    public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, "");

    /**
     * The column yrs_geodata.continent.code.
     */
    public final TableField CODE = createField(DSL.name("code"), SQLDataType.VARCHAR(2).nullable(false), this, "");

    /**
     * The column yrs_geodata.continent.name.
     */
    public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(32), this, "");

    /**
     * The column yrs_geodata.continent.external_id.
     */
    public final TableField EXTERNAL_ID = createField(DSL.name("external_id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, "");

    private Continent(Name alias, Table aliased) {
        this(alias, aliased, null);
    }

    private Continent(Name alias, Table aliased, Field[] parameters) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
    }

    /**
     * Create an aliased yrs_geodata.continent table reference
     */
    public Continent(String alias) {
        this(DSL.name(alias), CONTINENT);
    }

    /**
     * Create an aliased yrs_geodata.continent table reference
     */
    public Continent(Name alias) {
        this(alias, CONTINENT);
    }

    /**
     * Create a yrs_geodata.continent table reference
     */
    public Continent() {
        this(DSL.name("continent"), null);
    }

    public  Continent(Table child, ForeignKey key) {
        super(child, key, CONTINENT);
    }

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

    @Override
    public Identity getIdentity() {
        return (Identity) super.getIdentity();
    }

    @Override
    public UniqueKey getPrimaryKey() {
        return Keys.CONTINENT_PKEY;
    }

    @Override
    public List> getUniqueKeys() {
        return Arrays.asList(Keys.UK_CONTINENT_NAME, Keys.CONTINENT_EXTERNAL_ID_KEY);
    }

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

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

    @Override
    public Continent as(Table alias) {
        return new Continent(alias.getQualifiedName(), this);
    }

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

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

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

    // -------------------------------------------------------------------------
    // Row4 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row4 fieldsRow() {
        return (Row4) super.fieldsRow();
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Function)}.
     */
    public  SelectField mapping(Function4 from) {
        return convertFrom(Records.mapping(from));
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Class,
     * Function)}.
     */
    public  SelectField mapping(Class toType, Function4 from) {
        return convertFrom(toType, Records.mapping(from));
    }
}