ShowCollectionRepo.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.izouma.nineth.repo;
  2. import com.izouma.nineth.domain.ShowCollection;
  3. import org.springframework.data.jpa.repository.JpaRepository;
  4. import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
  5. import org.springframework.data.jpa.repository.Modifying;
  6. import org.springframework.data.jpa.repository.Query;
  7. import javax.transaction.Transactional;
  8. import java.util.Collection;
  9. import java.util.List;
  10. public interface ShowCollectionRepo extends JpaRepository<ShowCollection, Long>, JpaSpecificationExecutor<ShowCollection> {
  11. @Query("update ShowCollection t set t.del = true where t.id = ?1")
  12. @Modifying
  13. @Transactional
  14. void softDelete(Long id);
  15. @Query("update ShowCollection t set t.del = true where t.collectionId = ?1")
  16. @Modifying
  17. @Transactional
  18. void softDeleteCollection(Long collectionId);
  19. List<ShowCollection> findAllByShowroomId(Long showroomId);
  20. List<ShowCollection> findAllByShowroomIdIn(Collection<Long> showroomId);
  21. @Query("update ShowCollection t set t.del = true where t.showroomId = ?1")
  22. @Modifying
  23. @Transactional
  24. void softDeleteByRoom(Long showroomId);
  25. @Query("update ShowCollection t set t.del = true where t.id in ?1")
  26. @Modifying
  27. @Transactional
  28. void softDeleteByIdIn(Collection<Long> ids);
  29. }