-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBookmarkRepository.java
More file actions
26 lines (18 loc) · 1015 Bytes
/
BookmarkRepository.java
File metadata and controls
26 lines (18 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package project.flipnote.bookmark.repository;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import project.flipnote.bookmark.entity.Bookmark;
import project.flipnote.bookmark.entity.BookmarkTargetType;
public interface BookmarkRepository extends JpaRepository<Bookmark, Long> {
boolean existsByTargetTypeAndUserIdAndTargetId(BookmarkTargetType targetType, Long userId, Long targetId);
Optional<Bookmark> findByTargetTypeAndUserIdAndTargetId(BookmarkTargetType targetType, Long userId, Long targetId);
Page<Bookmark> findAllByTargetTypeAndUserId(BookmarkTargetType targetType, Long userId, Pageable pageable);
List<Bookmark> findAllByTargetTypeAndUserIdAndTargetIdIn(
BookmarkTargetType targetType, Long userId, Set<Long> targetIds
);
int deleteByTargetTypeAndTargetId(BookmarkTargetType targetType, Long targetId);
}