/* * This file is generated by jOOQ. */ package golf.handicap.generated.tables import golf.handicap.generated.DefaultSchema import golf.handicap.generated.keys.SCORES__FK_COURSE_SCORES import golf.handicap.generated.keys.SCORES__FK_GOLFER_SCORES import golf.handicap.generated.tables.Course.CoursePath import golf.handicap.generated.tables.Golfer.GolferPath import golf.handicap.generated.tables.records.ScoresRecord 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.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 Scores( 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 scores */ val SCORES: Scores = Scores() } /** * The class holding records for this type */ override fun getRecordType(): Class = ScoresRecord::class.java /** * The column scores.pin. */ val PIN: TableField = createField(DSL.name("pin"), SQLDataType.VARCHAR(8).nullable(false), this, "") /** * The column scores.gross_score. */ val GROSS_SCORE: TableField = createField(DSL.name("gross_score"), SQLDataType.INTEGER.nullable(false), this, "") /** * The column scores.net_score. */ val NET_SCORE: TableField = createField(DSL.name("net_score"), SQLDataType.REAL, this, "") /** * The column scores.adjusted_score. */ val ADJUSTED_SCORE: TableField = createField(DSL.name("adjusted_score"), SQLDataType.INTEGER.nullable(false), this, "") /** * The column scores.tee_time. */ val TEE_TIME: TableField = createField(DSL.name("tee_time"), SQLDataType.CLOB.nullable(false), this, "") /** * The column scores.handicap. */ val HANDICAP: TableField = createField(DSL.name("handicap"), SQLDataType.REAL, this, "") /** * The column scores.course_seq. */ val COURSE_SEQ: TableField = createField(DSL.name("course_seq"), SQLDataType.INTEGER, this, "") /** * The column scores.course_tees. */ val COURSE_TEES: TableField = createField(DSL.name("course_tees"), SQLDataType.INTEGER, this, "") /** * The column scores.used. */ val USED: TableField = createField(DSL.name("used"), SQLDataType.CHAR(1), 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 scores table reference */ constructor(alias: String): this(DSL.name(alias)) /** * Create an aliased scores table reference */ constructor(alias: Name): this(alias, null) /** * Create a scores table reference */ constructor(): this(DSL.name("scores"), null) constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, SCORES, null, null) /** * A subtype implementing {@link Path} for simplified path-based joins. */ open class ScoresPath : Scores, 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): ScoresPath = ScoresPath(DSL.name(alias), this) override fun `as`(alias: Name): ScoresPath = ScoresPath(alias, this) override fun `as`(alias: Table<*>): ScoresPath = ScoresPath(alias.qualifiedName, this) } override fun getSchema(): Schema? = if (aliased()) null else DefaultSchema.DEFAULT_SCHEMA override fun getReferences(): List> = listOf(SCORES__FK_COURSE_SCORES, SCORES__FK_GOLFER_SCORES) /** * Get the implicit join path to the course table. */ fun course(): CoursePath = course val course: CoursePath by lazy { CoursePath(this, SCORES__FK_COURSE_SCORES, null) } /** * Get the implicit join path to the golfer table. */ fun golfer(): GolferPath = golfer val golfer: GolferPath by lazy { GolferPath(this, SCORES__FK_GOLFER_SCORES, null) } override fun `as`(alias: String): Scores = Scores(DSL.name(alias), this) override fun `as`(alias: Name): Scores = Scores(alias, this) override fun `as`(alias: Table<*>): Scores = Scores(alias.qualifiedName, this) /** * Rename this table */ override fun rename(name: String): Scores = Scores(DSL.name(name), null) /** * Rename this table */ override fun rename(name: Name): Scores = Scores(name, null) /** * Rename this table */ override fun rename(name: Table<*>): Scores = Scores(name.qualifiedName, null) /** * Create an inline derived table from this table */ override fun where(condition: Condition?): Scores = Scores(qualifiedName, if (aliased()) this else null, Internal.condition(this, condition)) /** * Create an inline derived table from this table */ override fun where(conditions: Collection): Scores = where(DSL.and(conditions)) /** * Create an inline derived table from this table */ override fun where(vararg conditions: Condition?): Scores = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ override fun where(condition: Field?): Scores = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(condition: SQL): Scores = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String): Scores = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Scores = where(DSL.condition(condition, *binds)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Scores = where(DSL.condition(condition, *parts)) /** * Create an inline derived table from this table */ override fun whereExists(select: TableLike<*>): Scores = where(DSL.exists(select)) /** * Create an inline derived table from this table */ override fun whereNotExists(select: TableLike<*>): Scores = where(DSL.notExists(select)) }