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

main.app.cash.backfila.client.jooq.gen.tables.Menu.kt Maven / Gradle / Ivy

Go to download

Backfila is a service that manages backfill state, calling into other services to do batched work.

There is a newer version: 2024.10.28.205607-fab304f
Show newest version
/*
 * This file is generated by jOOQ.
 */
package app.cash.backfila.client.jooq.gen.tables

import app.cash.backfila.client.jooq.gen.Jooq
import app.cash.backfila.client.jooq.gen.keys.KEY_MENU_PRIMARY
import app.cash.backfila.client.jooq.gen.tables.records.MenuRecord
import org.jooq.Field
import org.jooq.ForeignKey
import org.jooq.Identity
import org.jooq.Name
import org.jooq.Record
import org.jooq.Records
import org.jooq.Row2
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.Internal
import org.jooq.impl.SQLDataType
import org.jooq.impl.TableImpl

/**
 * This class is generated by jOOQ.
 */
@Suppress("UNCHECKED_CAST")
open class Menu(
  alias: Name,
  child: Table?,
  path: ForeignKey?,
  aliased: Table?,
  parameters: Array?>?,
) : TableImpl(
  alias,
  Jooq.JOOQ,
  child,
  path,
  aliased,
  parameters,
  DSL.comment(""),
  TableOptions.table(),
) {
  companion object {

    /**
     * The reference instance of jooq.menu
     */
    val MENU: Menu = Menu()
  }

  /**
   * The class holding records for this type
   */
  override fun getRecordType(): Class = MenuRecord::class.java

  /**
   * The column jooq.menu.id.
   */
  val ID: TableField = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "")

  /**
   * The column jooq.menu.name.
   */
  val NAME: TableField = createField(DSL.name("name"), SQLDataType.VARCHAR(128).nullable(false), this, "")

  private constructor(alias: Name, aliased: Table?) : this(alias, null, null, aliased, null)
  private constructor(alias: Name, aliased: Table?, parameters: Array?>?) : this(alias, null, null, aliased, parameters)

  /**
   * Create an aliased jooq.menu table reference
   */
  constructor(alias: String) : this(DSL.name(alias))

  /**
   * Create an aliased jooq.menu table reference
   */
  constructor(alias: Name) : this(alias, null)

  /**
   * Create a jooq.menu table reference
   */
  constructor() : this(DSL.name("menu"), null)

  constructor(child: Table, key: ForeignKey) : this(Internal.createPathAlias(child, key), child, key, MENU, null)
  override fun getSchema(): Schema? = if (aliased()) null else Jooq.JOOQ
  override fun getIdentity(): Identity = super.getIdentity() as Identity
  override fun getPrimaryKey(): UniqueKey = KEY_MENU_PRIMARY
  override fun `as`(alias: String): Menu = Menu(DSL.name(alias), this)
  override fun `as`(alias: Name): Menu = Menu(alias, this)
  override fun `as`(alias: Table<*>): Menu = Menu(alias.getQualifiedName(), this)

  /**
   * Rename this table
   */
  override fun rename(name: String): Menu = Menu(DSL.name(name), null)

  /**
   * Rename this table
   */
  override fun rename(name: Name): Menu = Menu(name, null)

  /**
   * Rename this table
   */
  override fun rename(name: Table<*>): Menu = Menu(name.getQualifiedName(), null)

  // -------------------------------------------------------------------------
  // Row2 type methods
  // -------------------------------------------------------------------------
  override fun fieldsRow(): Row2 = super.fieldsRow() as Row2

  /**
   * Convenience mapping calling {@link SelectField#convertFrom(Function)}.
   */
  fun  mapping(from: (Long?, String?) -> U): SelectField = convertFrom(Records.mapping(from))

  /**
   * Convenience mapping calling {@link SelectField#convertFrom(Class,
   * Function)}.
   */
  fun  mapping(toType: Class, from: (Long?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from))
}