/* * This file is generated by jOOQ. */ package golf.handicap.generated.tables import golf.handicap.generated.DefaultSchema import golf.handicap.generated.keys.GOLFER_NAMES_UNIQUE import golf.handicap.generated.keys.GOLFER_PKEY import golf.handicap.generated.keys.SCORES__FK_GOLFER_SCORES import golf.handicap.generated.tables.Scores.ScoresPath import golf.handicap.generated.tables.records.GolferRecord import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Path import org.jooq.PlainSQL import org.jooq.QueryPart import org.jooq.Record import org.jooq.SQL import org.jooq.Schema import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableLike 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("warnings") open class Golfer( alias: Name, path: Table?, childPath: ForeignKey?, parentPath: InverseForeignKey?, aliased: Table?, parameters: Array?>?, where: Condition? ): TableImpl( alias, DefaultSchema.DEFAULT_SCHEMA, path, childPath, parentPath, aliased, parameters, DSL.comment(""), TableOptions.table(), where, ) { companion object { /** * The reference instance of golfer */ val GOLFER: Golfer = Golfer() } /** * The class holding records for this type */ override fun getRecordType(): Class = GolferRecord::class.java /** * The column golfer.pin. */ val PIN: TableField = createField(DSL.name("pin"), SQLDataType.VARCHAR(8).nullable(false), this, "") /** * The column golfer.first_name. */ val FIRST_NAME: TableField = createField(DSL.name("first_name"), SQLDataType.VARCHAR(32).nullable(false), this, "") /** * The column golfer.last_name. */ val LAST_NAME: TableField = createField(DSL.name("last_name"), SQLDataType.VARCHAR(32).nullable(false), this, "") /** * The column golfer.handicap. */ val HANDICAP: TableField = createField(DSL.name("handicap"), SQLDataType.REAL.defaultValue(DSL.field(DSL.raw("0.0"), SQLDataType.REAL)), this, "") /** * The column golfer.country. */ val COUNTRY: TableField = createField(DSL.name("country"), SQLDataType.CHAR(2).nullable(false).defaultValue(DSL.field(DSL.raw("'US'::bpchar"), SQLDataType.CHAR)), this, "") /** * The column golfer.state. */ val STATE: TableField = createField(DSL.name("state"), SQLDataType.CHAR(2).nullable(false).defaultValue(DSL.field(DSL.raw("'NV'::bpchar"), SQLDataType.CHAR)), this, "") /** * The column golfer.overlap_years. */ val OVERLAP_YEARS: TableField = createField(DSL.name("overlap_years"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "") /** * The column golfer.public. */ val PUBLIC: TableField = createField(DSL.name("public"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "") /** * The column golfer.last_login. */ val LAST_LOGIN: TableField = createField(DSL.name("last_login"), SQLDataType.BIGINT, this, "") private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased golfer table reference */ constructor(alias: String): this(DSL.name(alias)) /** * Create an aliased golfer table reference */ constructor(alias: Name): this(alias, null) /** * Create a golfer table reference */ constructor(): this(DSL.name("golfer"), null) constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, GOLFER, null, null) /** * A subtype implementing {@link Path} for simplified path-based joins. */ open class GolferPath : Golfer, Path { constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) private constructor(alias: Name, aliased: Table): super(alias, aliased) override fun `as`(alias: String): GolferPath = GolferPath(DSL.name(alias), this) override fun `as`(alias: Name): GolferPath = GolferPath(alias, this) override fun `as`(alias: Table<*>): GolferPath = GolferPath(alias.qualifiedName, this) } override fun getSchema(): Schema? = if (aliased()) null else DefaultSchema.DEFAULT_SCHEMA override fun getPrimaryKey(): UniqueKey = GOLFER_PKEY override fun getUniqueKeys(): List> = listOf(GOLFER_NAMES_UNIQUE) private lateinit var _scores: ScoresPath /** * Get the implicit to-many join path to the scores table */ fun scores(): ScoresPath { if (!this::_scores.isInitialized) _scores = ScoresPath(this, null, SCORES__FK_GOLFER_SCORES.inverseKey) return _scores; } val scores: ScoresPath get(): ScoresPath = scores() override fun `as`(alias: String): Golfer = Golfer(DSL.name(alias), this) override fun `as`(alias: Name): Golfer = Golfer(alias, this) override fun `as`(alias: Table<*>): Golfer = Golfer(alias.qualifiedName, this) /** * Rename this table */ override fun rename(name: String): Golfer = Golfer(DSL.name(name), null) /** * Rename this table */ override fun rename(name: Name): Golfer = Golfer(name, null) /** * Rename this table */ override fun rename(name: Table<*>): Golfer = Golfer(name.qualifiedName, null) /** * Create an inline derived table from this table */ override fun where(condition: Condition?): Golfer = Golfer(qualifiedName, if (aliased()) this else null, Internal.condition(this, condition)) /** * Create an inline derived table from this table */ override fun where(conditions: Collection): Golfer = where(DSL.and(conditions)) /** * Create an inline derived table from this table */ override fun where(vararg conditions: Condition?): Golfer = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ override fun where(condition: Field?): Golfer = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(condition: SQL): Golfer = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String): Golfer = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Golfer = where(DSL.condition(condition, *binds)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Golfer = where(DSL.condition(condition, *parts)) /** * Create an inline derived table from this table */ override fun whereExists(select: TableLike<*>): Golfer = where(DSL.exists(select)) /** * Create an inline derived table from this table */ override fun whereNotExists(select: TableLike<*>): Golfer = where(DSL.notExists(select)) }