/* * This file is generated by jOOQ. */ package golf.handicap.generated.tables import golf.handicap.generated.DefaultSchema import golf.handicap.generated.keys.COURSE_PKEY import golf.handicap.generated.keys.RATINGS__FK_COURSE_RATINGS import golf.handicap.generated.keys.SCORES__FK_COURSE_SCORES import golf.handicap.generated.tables.Ratings.RatingsPath import golf.handicap.generated.tables.Scores.ScoresPath import golf.handicap.generated.tables.records.CourseRecord import kotlin.collections.Collection import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity 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 Course( 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 course */ val COURSE: Course = Course() } /** * The class holding records for this type */ override fun getRecordType(): Class = CourseRecord::class.java /** * The column course.course_seq. */ val COURSE_SEQ: TableField = createField(DSL.name("course_seq"), SQLDataType.INTEGER.nullable(false).identity(true), this, "") /** * The column course.course_name. */ val COURSE_NAME: TableField = createField(DSL.name("course_name"), SQLDataType.VARCHAR(128).nullable(false), this, "") /** * The column course.course_country. */ val COURSE_COUNTRY: TableField = createField(DSL.name("course_country"), SQLDataType.VARCHAR(128).nullable(false), this, "") /** * The column course.course_state. */ val COURSE_STATE: TableField = createField(DSL.name("course_state"), SQLDataType.CHAR(2).nullable(false), 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 course table reference */ constructor(alias: String): this(DSL.name(alias)) /** * Create an aliased course table reference */ constructor(alias: Name): this(alias, null) /** * Create a course table reference */ constructor(): this(DSL.name("course"), null) constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, COURSE, null, null) /** * A subtype implementing {@link Path} for simplified path-based joins. */ open class CoursePath : Course, 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): CoursePath = CoursePath(DSL.name(alias), this) override fun `as`(alias: Name): CoursePath = CoursePath(alias, this) override fun `as`(alias: Table<*>): CoursePath = CoursePath(alias.qualifiedName, this) } override fun getSchema(): Schema? = if (aliased()) null else DefaultSchema.DEFAULT_SCHEMA override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = COURSE_PKEY private lateinit var _ratings: RatingsPath /** * Get the implicit to-many join path to the public.ratings * table */ fun ratings(): RatingsPath { if (!this::_ratings.isInitialized) _ratings = RatingsPath(this, null, RATINGS__FK_COURSE_RATINGS.inverseKey) return _ratings; } val ratings: RatingsPath get(): RatingsPath = ratings() private lateinit var _scores: ScoresPath /** * Get the implicit to-many join path to the public.scores * table */ fun scores(): ScoresPath { if (!this::_scores.isInitialized) _scores = ScoresPath(this, null, SCORES__FK_COURSE_SCORES.inverseKey) return _scores; } val scores: ScoresPath get(): ScoresPath = scores() override fun `as`(alias: String): Course = Course(DSL.name(alias), this) override fun `as`(alias: Name): Course = Course(alias, this) override fun `as`(alias: Table<*>): Course = Course(alias.qualifiedName, this) /** * Rename this table */ override fun rename(name: String): Course = Course(DSL.name(name), null) /** * Rename this table */ override fun rename(name: Name): Course = Course(name, null) /** * Rename this table */ override fun rename(name: Table<*>): Course = Course(name.qualifiedName, null) /** * Create an inline derived table from this table */ override fun where(condition: Condition?): Course = Course(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table */ override fun where(conditions: Collection): Course = where(DSL.and(conditions)) /** * Create an inline derived table from this table */ override fun where(vararg conditions: Condition?): Course = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ override fun where(condition: Field?): Course = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(condition: SQL): Course = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String): Course = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Course = where(DSL.condition(condition, *binds)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Course = where(DSL.condition(condition, *parts)) /** * Create an inline derived table from this table */ override fun whereExists(select: Select<*>): Course = where(DSL.exists(select)) /** * Create an inline derived table from this table */ override fun whereNotExists(select: Select<*>): Course = where(DSL.notExists(select)) }