package com.izouma.nineth.repo;

import com.izouma.nineth.domain.ActivityCollectionInfo;
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;

public interface ActivityCollectionInfoRepo extends JpaRepository<ActivityCollectionInfo, Long>, JpaSpecificationExecutor<ActivityCollectionInfo> {
    @Query(value = "update activity_collection_info t set t.del = 1 where t.activity_id = ?1 " ,nativeQuery = true)
    @Modifying
    @Transactional
    void softDeleteByActivityId(Long id);

}