Skip to content

Commit 7b457ae

Browse files
committed
feat(FontRepository): add pageable support for the findCharsByFontId method
1 parent 15e8dfd commit 7b457ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/net/onelitefeather/vulpes/api/repository/FontRepository.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import io.micronaut.data.annotation.Query;
44
import io.micronaut.data.annotation.Repository;
5+
import io.micronaut.data.model.Pageable;
56
import io.micronaut.data.repository.PageableRepository;
67
import net.onelitefeather.vulpes.api.model.FontEntity;
78

@@ -24,8 +25,11 @@ public interface FontRepository extends PageableRepository<FontEntity, UUID> {
2425
* @param id the unique identifier of the font
2526
* @return a list of characters associated with the font
2627
*/
27-
@Query("SELECT c FROM fonts f JOIN f.chars c WHERE f.id = :id")
28-
List<String> findCharsByFontId(UUID id);
28+
@Query(
29+
value = "SELECT c FROM fonts f JOIN f.chars c WHERE f.id = :id",
30+
countQuery = "SELECT COUNT(c) FROM fonts f JOIN f.chars c WHERE f.id = :id"
31+
)
32+
List<String> findCharsByFontId(UUID id, Pageable pageable);
2933

3034
/**
3135
* Retrieves all fonts along with their associated characters.

0 commit comments

Comments
 (0)