package com.izouma.nineth.repo; import com.izouma.nineth.domain.ShowCollection; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import javax.transaction.Transactional; import java.util.Collection; import java.util.List; public interface ShowCollectionRepo extends JpaRepository, JpaSpecificationExecutor { @Query("update ShowCollection t set t.del = true where t.id = ?1") @Modifying @Transactional void softDelete(Long id); @Query("update ShowCollection t set t.del = true where t.collectionId = ?1") @Modifying @Transactional void softDeleteCollection(Long collectionId); List findAllByShowroomId(Long showroomId); List findAllByShowroomIdIn(Collection showroomId); @Query("update ShowCollection t set t.del = true where t.showroomId = ?1") @Modifying @Transactional void softDeleteByRoom(Long showroomId); @Query("update ShowCollection t set t.del = true where t.id in ?1") @Modifying @Transactional void softDeleteByIdIn(Collection ids); }