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

org.babyfish.jimmer.sql.kt.KAssociations.kt Maven / Gradle / Ivy

There is a newer version: 0.8.184
Show newest version
package org.babyfish.jimmer.sql.kt

import org.babyfish.jimmer.lang.NewChain
import org.babyfish.jimmer.sql.ast.tuple.Tuple2
import java.sql.Connection

interface KAssociations {

    @NewChain
    fun forConnection(con: Connection): KAssociations

    @NewChain
    fun reverse(): KAssociations

    @NewChain
    fun checkExistence(checkExistence: Boolean = true): KAssociations

    @NewChain
    fun deleteUnnecessary(deleteUnnecessary: Boolean = true): KAssociations

    fun save(
        sourceId: Any,
        targetId: Any,
        checkExistence: Boolean? = null,
        deleteUnnecessary: Boolean? = null,
        con: Connection? = null
    ): Int

    fun saveAll(
        sourceIds: Collection<*>,
        targetIds: Collection<*>,
        checkExistence: Boolean? = null,
        deleteUnnecessary: Boolean? = null,
        con: Connection? = null
    ): Int

    @Deprecated(
        "Will be deleted in 1.0, please use saveAll",
        replaceWith = ReplaceWith("saveAll")
    )
    fun batchSave(
        sourceIds: Collection<*>,
        targetIds: Collection<*>,
        checkExistence: Boolean? = null,
        deleteUnnecessary: Boolean? = null,
        con: Connection? = null
    ): Int =
        saveAll(sourceIds, targetIds, checkExistence, deleteUnnecessary, con)

    fun saveAll(
        idTuples: Collection>,
        checkExistence: Boolean? = null,
        deleteUnnecessary: Boolean? = null,
        con: Connection? = null
    ): Int

    @Deprecated(
        "Will be deleted in 1.0, please use saveAll",
        replaceWith = ReplaceWith("saveAll")
    )
    fun batchSave(
        idTuples: Collection>,
        checkExistence: Boolean? = null,
        deleteUnnecessary: Boolean? = null,
        con: Connection? = null
    ): Int =
        saveAll(idTuples, checkExistence, deleteUnnecessary, con)

    fun delete(
        sourceId: Any,
        targetId: Any,
        con: Connection? = null
    ): Int

    fun deleteAll(
        sourceIds: Collection<*>,
        targetIds: Collection<*>,
        con: Connection? = null
    ): Int

    @Deprecated(
        "Will be deleted in 1.0, please use deleteAll",
        replaceWith = ReplaceWith("deleteAll")
    )
    fun batchDelete(
        sourceIds: Collection<*>,
        targetIds: Collection<*>,
        con: Connection? = null
    ): Int =
        deleteAll(sourceIds, targetIds, con)

    fun deleteAll(
        idTuples: Collection>,
        con: Connection? = null
    ): Int

    @Deprecated(
        "Will be deleted in 1.0, please use deleteAll",
        replaceWith = ReplaceWith("deleteAll")
    )
    fun batchDelete(
        idTuples: Collection>,
        con: Connection? = null
    ): Int =
        deleteAll(idTuples, con)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy