package com.izouma.nineth.repo; import com.izouma.nineth.domain.SpaceObjectsInfo; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import javax.transaction.Transactional; import java.util.List; public interface SpaceObjectsInfoRepo extends JpaRepository { SpaceObjectsInfo findBySpaceIdAndDel(Long spaceId, boolean del); List findAllByUserIdAndDel(Long userId, boolean del); List findAllByUserIdAndDelAndIdNot(Long userId, boolean del, Long id); @Query("update SpaceObjectsInfo t set t.del = true where t.spaceId = ?1") @Modifying @Transactional void softDelete(Long id); @Query("update SpaceObjectsInfo t set t.buildingPosList = '' where t.userId = ?1") @Modifying @Transactional void updateByUserId(Long userId); }