IsNotifiedRepository.java 705 Bytes
Newer Older
manxiaoqiang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
package tkio.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.transaction.annotation.Transactional;
import tkio.model.IsNotified;

@Transactional
public interface IsNotifiedRepository extends JpaRepository<IsNotified, Long> {
    @Query(value = "select * from is_notified where account_id=?1", nativeQuery = true)
    IsNotified findIsNotifiedByAccountId(Long accountId);

    @Modifying
    @Transactional
    @Query(value = "delete from is_notified where account_id=?1", nativeQuery = true)
    int deleteByAccountId(Long accountId);


}