/* * This file is generated by jOOQ. */ package golf.handicap.generated.tables import golf.handicap.generated.DefaultSchema import golf.handicap.generated.keys.RATINGS_PKEY import golf.handicap.generated.keys.RATINGS__FK_COURSE_RATINGS import golf.handicap.generated.tables.Course.CoursePath import golf.handicap.generated.tables.records.RatingsRecord 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.Select import org.jooq.Stringly 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 Ratings( 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 ratings */ val RATINGS: Ratings = Ratings() } /** * The class holding records for this type */ override fun getRecordType(): Class = RatingsRecord::class.java /** * The column ratings.course_seq. */ val COURSE_SEQ: TableField = createField(DSL.name("course_seq"), SQLDataType.INTEGER.nullable(false), this, "") /** * The column ratings.tee. */ val TEE: TableField = createField(DSL.name("tee"), SQLDataType.INTEGER.nullable(false), this, "") /** * The column ratings.tee_color. */ val TEE_COLOR: TableField = createField(DSL.name("tee_color"), SQLDataType.VARCHAR(16), this, "") /** * The column ratings.tee_rating. */ val TEE_RATING: TableField = createField(DSL.name("tee_rating"), SQLDataType.REAL.nullable(false), this, "") /** * The column ratings.tee_slope. */ val TEE_SLOPE: TableField = createField(DSL.name("tee_slope"), SQLDataType.INTEGER.nullable(false), this, "") /** * The column ratings.tee_par. */ val TEE_PAR: TableField = createField(DSL.name("tee_par"), SQLDataType.INTEGER.nullable(false).defaultValue(DSL.field(DSL.raw("72"), SQLDataType.INTEGER)), 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 ratings table reference */ constructor(alias: String): this(DSL.name(alias)) /** * Create an aliased ratings table reference */ constructor(alias: Name): this(alias, null) /** * Create a ratings table reference */ constructor(): this(DSL.name("ratings"), null) constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, RATINGS, null, null) /** * A subtype implementing {@link Path} for simplified path-based joins. */ open class RatingsPath : Ratings, 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): RatingsPath = RatingsPath(DSL.name(alias), this) override fun `as`(alias: Name): RatingsPath = RatingsPath(alias, this) override fun `as`(alias: Table<*>): RatingsPath = RatingsPath(alias.qualifiedName, this) } override fun getSchema(): Schema? = if (aliased()) null else DefaultSchema.DEFAULT_SCHEMA override fun getPrimaryKey(): UniqueKey = RATINGS_PKEY override fun getReferences(): List> = listOf(RATINGS__FK_COURSE_RATINGS) private lateinit var _course: CoursePath /** * Get the implicit join path to the public.course table. */ fun course(): CoursePath { if (!this::_course.isInitialized) _course = CoursePath(this, RATINGS__FK_COURSE_RATINGS, null) return _course; } val course: CoursePath get(): CoursePath = course() override fun `as`(alias: String): Ratings = Ratings(DSL.name(alias), this) override fun `as`(alias: Name): Ratings = Ratings(alias, this) override fun `as`(alias: Table<*>): Ratings = Ratings(alias.qualifiedName, this) /** * Rename this table */ override fun rename(name: String): Ratings = Ratings(DSL.name(name), null) /** * Rename this table */ override fun rename(name: Name): Ratings = Ratings(name, null) /** * Rename this table */ override fun rename(name: Table<*>): Ratings = Ratings(name.qualifiedName, null) /** * Create an inline derived table from this table */ override fun where(condition: Condition?): Ratings = Ratings(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table */ override fun where(conditions: Collection): Ratings = where(DSL.and(conditions)) /** * Create an inline derived table from this table */ override fun where(vararg conditions: Condition?): Ratings = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ override fun where(condition: Field?): Ratings = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(condition: SQL): Ratings = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String): Ratings = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Ratings = where(DSL.condition(condition, *binds)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Ratings = where(DSL.condition(condition, *parts)) /** * Create an inline derived table from this table */ override fun whereExists(select: Select<*>): Ratings = where(DSL.exists(select)) /** * Create an inline derived table from this table */ override fun whereNotExists(select: Select<*>): Ratings = where(DSL.notExists(select)) }