/* * This file is generated by jOOQ. */ package golf.handicap.generated.tables import golf.handicap.generated.DefaultSchema import golf.handicap.generated.keys.GROUPS_PKEY import golf.handicap.generated.keys.MEMBER__MEMBER_GROUP_ID_FOREIGN import golf.handicap.generated.keys.NAME_UKEY import golf.handicap.generated.tables.Member.MemberPath import golf.handicap.generated.tables.records.GroupsRecord import java.time.OffsetDateTime import kotlin.collections.Collection import kotlin.collections.List 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.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 Groups( 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 groups */ val GROUPS: Groups = Groups() } /** * The class holding records for this type */ override fun getRecordType(): Class = GroupsRecord::class.java /** * The column groups.id. */ val ID: TableField = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).generatedAlwaysAsIdentity(), this, "") /** * The column groups.name. */ val NAME: TableField = createField(DSL.name("name"), SQLDataType.VARCHAR(24), this, "") /** * The column groups.owner. */ val OWNER: TableField = createField(DSL.name("owner"), SQLDataType.INTEGER.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.INTEGER)), this, "") /** * The column groups.created. */ val CREATED: TableField = createField(DSL.name("created"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, "") /** * The column groups.updated. */ val UPDATED: TableField = createField(DSL.name("updated"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), 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 groups table reference */ constructor(alias: String): this(DSL.name(alias)) /** * Create an aliased groups table reference */ constructor(alias: Name): this(alias, null) /** * Create a groups table reference */ constructor(): this(DSL.name("groups"), null) constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, GROUPS, null, null) /** * A subtype implementing {@link Path} for simplified path-based joins. */ open class GroupsPath : Groups, 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): GroupsPath = GroupsPath(DSL.name(alias), this) override fun `as`(alias: Name): GroupsPath = GroupsPath(alias, this) override fun `as`(alias: Table<*>): GroupsPath = GroupsPath(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 = GROUPS_PKEY override fun getUniqueKeys(): List> = listOf(NAME_UKEY) private lateinit var _member: MemberPath /** * Get the implicit to-many join path to the member table */ fun member(): MemberPath { if (!this::_member.isInitialized) _member = MemberPath(this, null, MEMBER__MEMBER_GROUP_ID_FOREIGN.inverseKey) return _member; } val member: MemberPath get(): MemberPath = member() override fun `as`(alias: String): Groups = Groups(DSL.name(alias), this) override fun `as`(alias: Name): Groups = Groups(alias, this) override fun `as`(alias: Table<*>): Groups = Groups(alias.qualifiedName, this) /** * Rename this table */ override fun rename(name: String): Groups = Groups(DSL.name(name), null) /** * Rename this table */ override fun rename(name: Name): Groups = Groups(name, null) /** * Rename this table */ override fun rename(name: Table<*>): Groups = Groups(name.qualifiedName, null) /** * Create an inline derived table from this table */ override fun where(condition: Condition?): Groups = Groups(qualifiedName, if (aliased()) this else null, Internal.condition(this, condition)) /** * Create an inline derived table from this table */ override fun where(conditions: Collection): Groups = where(DSL.and(conditions)) /** * Create an inline derived table from this table */ override fun where(vararg conditions: Condition?): Groups = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ override fun where(condition: Field?): Groups = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(condition: SQL): Groups = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String): Groups = where(DSL.condition(condition)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Groups = where(DSL.condition(condition, *binds)) /** * Create an inline derived table from this table */ @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Groups = where(DSL.condition(condition, *parts)) /** * Create an inline derived table from this table */ override fun whereExists(select: TableLike<*>): Groups = where(DSL.exists(select)) /** * Create an inline derived table from this table */ override fun whereNotExists(select: TableLike<*>): Groups = where(DSL.notExists(select)) }