package space.nstart.pcp.pcp_satellites_service.repository

import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param
import space.nstart.pcp.pcp_satellites_service.entity.SatelliteModeCellEntity

interface SatelliteModeCellRepository : JpaRepository<SatelliteModeCellEntity, Long> {
    fun findAllByMode_IdIn(modeIds: Collection<Long>): List<SatelliteModeCellEntity>

    @Modifying
    @Query("delete from SatelliteModeCellEntity entity where entity.mode.id in :modeIds")
    fun deleteAllByModeIds(@Param("modeIds") modeIds: Collection<Long>): Int
}
