All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sxtanna.db.struct.statement.insert.kt Maven / Gradle / Ivy

There is a newer version: 1.6
Show newest version
package com.sxtanna.db.struct.statement

import com.sxtanna.db.struct.Table
import com.sxtanna.db.struct.base.Duplicate

/**
 * An object that can insert rows into a table
 */
interface Inserter {

    /**
     * Insert these rows into this table
     *  * Executes automatically
     */
    fun  insert(table : Table, vararg rows : E) {
        insert(table, rows.toList())
    }

    /**
     * Insert these rows into this table
     *  * Executes automatically
     */
    fun  insert(table : Table, rows : Collection)

    /**
     * Insert these rows into this table, using this duplicate key flag
     *  * Executes automatically
     */
    fun  insert(table : Table, duplicate : Duplicate>, vararg rows : E) {
        insert(table, duplicate, rows.toList())
    }

    /**
     * Insert these rows into this table, using this duplicate key flag
     *  * Executes automatically
     */
    fun  insert(table : Table, duplicate : Duplicate>, rows : Collection)


    /**
     * An object that can insert rows into its table
     */
    interface TableInserter {

        /**
         * @see [Inserter.insert]
         */
        fun insert(vararg rows : E) {
            insert(rows.toList())
        }

        /**
         * Insert.insert(table : Table<E>, rows : Collection<E>)
         *
         * @sample [Cannot_link_to_specific_method][insert]
         */
        fun insert(rows : Collection)

        /**
         * Insert.insert(table : Table<E>, duplicate : Duplicate<Table<E>>, vararg rows : E)
         *
         * @sample [Cannot_link_to_specific_method][insert]
         */
        fun insert(duplicate : Duplicate>, vararg rows : E) {
            insert(duplicate, rows.toList())
        }

        /**
         * Insert.insert(table : Table<E>, duplicate : Duplicate<Table<E>>, rows : Collection<E>)
         *
         * @sample [Cannot_link_to_specific_method][insert]
         */
        fun insert(duplicate : Duplicate>, rows : Collection)

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy