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 DBInserter {

    /**
     * Insert these rows into this table
     *  * Executes automatically
     */
    fun  insert(table : Table, vararg rows : T) {
        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 : T) {
        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 [DBInserter.insert]
         */
        fun insert(vararg rows : T) {
            insert(rows.toList())
        }

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

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

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

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy