package com.YuyeTech.HeartRate.repository;

import com.YuyeTech.HeartRate.dataobject.Favorites;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

/**
 * @author:slambb
 * @date:2020/1/14
 */
public interface FavoritesServiceRepository extends JpaRepository<Favorites,Integer> {
    List<Favorites> findByUserId(String userId, Pageable pageable);
    //查询是否存在对应数据
    Optional<Favorites> findByUserIdAndFObjectId(String userId,String fObjectId);

    void deleteByUserIdAndFObjectId(String userId,String fObjectId);

    void deleteFavoritesByUserIdAndFObjectId(String userId,String fObjectId);
}
