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

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

/*
 * 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.indexes.WIDGETS_MANUFACTURER_CREATED_AT
import app.cash.backfila.client.jooq.gen.keys.KEY_WIDGETS_PRIMARY
import app.cash.backfila.client.jooq.gen.tables.records.WidgetsRecord
import kotlin.collections.List
import org.jooq.Field
import org.jooq.ForeignKey
import org.jooq.Index
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.Internal
import org.jooq.impl.SQLDataType
import org.jooq.impl.TableImpl

/**
 * This class is generated by jOOQ.
 */
@Suppress("UNCHECKED_CAST")
open class Widgets(
  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.widgets
     */
    val WIDGETS: Widgets = Widgets()
  }

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

  /**
   * The column jooq.widgets.widget_token.
   */
  val WIDGET_TOKEN: TableField = createField(DSL.name("widget_token"), SQLDataType.VARBINARY(64).nullable(false), this, "")

  /**
   * The column jooq.widgets.manufacturer_token.
   */
  val MANUFACTURER_TOKEN: TableField = createField(DSL.name("manufacturer_token"), SQLDataType.VARCHAR(255).nullable(false), this, "")

  /**
   * The column jooq.widgets.created_at_ms.
   */
  val CREATED_AT_MS: TableField = createField(DSL.name("created_at_ms"), SQLDataType.BIGINT.nullable(false), this, "")

  /**
   * The column jooq.widgets.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.widgets table reference
   */
  constructor(alias: String) : this(DSL.name(alias))

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

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

  constructor(child: Table, key: ForeignKey) : this(Internal.createPathAlias(child, key), child, key, WIDGETS, null)
  override fun getSchema(): Schema? = if (aliased()) null else Jooq.JOOQ
  override fun getIndexes(): List = listOf(WIDGETS_MANUFACTURER_CREATED_AT)
  override fun getPrimaryKey(): UniqueKey = KEY_WIDGETS_PRIMARY
  override fun `as`(alias: String): Widgets = Widgets(DSL.name(alias), this)
  override fun `as`(alias: Name): Widgets = Widgets(alias, this)
  override fun `as`(alias: Table<*>): Widgets = Widgets(alias.getQualifiedName(), this)

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

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

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

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

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

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