/*
 * This file is generated by jOOQ.
 */
package jooq.main.tables.daos


import jooq.main.tables.ArticleTopic
import jooq.main.tables.records.ArticleTopicRecord

import kotlin.collections.List

import org.jooq.Configuration
import org.jooq.Record2
import org.jooq.impl.DAOImpl


/**
 * This class is generated by jOOQ.
 */
@Suppress("UNCHECKED_CAST")
open class ArticleTopicDao(configuration: Configuration?) : DAOImpl<ArticleTopicRecord, jooq.main.tables.pojos.ArticleTopic, Record2<Long?, Long?>>(ArticleTopic.ARTICLE_TOPIC, jooq.main.tables.pojos.ArticleTopic::class.java, configuration) {

    /**
     * Create a new ArticleTopicDao without any configuration
     */
    constructor(): this(null)

    override fun getId(o: jooq.main.tables.pojos.ArticleTopic): Record2<Long?, Long?> = compositeKeyRecord(o.articleId, o.topicId)

    /**
     * Fetch records that have <code>article_id BETWEEN lowerInclusive AND
     * upperInclusive</code>
     */
    fun fetchRangeOfArticleId(lowerInclusive: Long?, upperInclusive: Long?): List<jooq.main.tables.pojos.ArticleTopic> = fetchRange(ArticleTopic.ARTICLE_TOPIC.ARTICLE_ID, lowerInclusive, upperInclusive)

    /**
     * Fetch records that have <code>article_id IN (values)</code>
     */
    fun fetchByArticleId(vararg values: Long): List<jooq.main.tables.pojos.ArticleTopic> = fetch(ArticleTopic.ARTICLE_TOPIC.ARTICLE_ID, *values.toTypedArray())

    /**
     * Fetch records that have <code>topic_id BETWEEN lowerInclusive AND
     * upperInclusive</code>
     */
    fun fetchRangeOfTopicId(lowerInclusive: Long?, upperInclusive: Long?): List<jooq.main.tables.pojos.ArticleTopic> = fetchRange(ArticleTopic.ARTICLE_TOPIC.TOPIC_ID, lowerInclusive, upperInclusive)

    /**
     * Fetch records that have <code>topic_id IN (values)</code>
     */
    fun fetchByTopicId(vararg values: Long): List<jooq.main.tables.pojos.ArticleTopic> = fetch(ArticleTopic.ARTICLE_TOPIC.TOPIC_ID, *values.toTypedArray())
}
