Skip to content

Commit

Permalink
Use int for count query instead of list of array of objects
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Nuyanzin <[email protected]>
  • Loading branch information
snuyanzin authored Oct 13, 2023
1 parent fd39190 commit c5407b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ public boolean existsComponentsCountForUser(String userId, int tenantId) {
}

public int getAllTopicsCountInAllTenants() {
return ((Long) topicRepo.findAllTopicsCount().get(0)[0]).intValue();
return topicRepo.findAllTopicsCount();
}

// teamId is requestedBy. For 'topics' all the requests are assigned to the same team, except
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/io/aiven/klaw/repository/TopicRepo.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Integer findDistinctCountTopicnameByTeamId(
List<Object[]> findAllTopicsGroupByTeamId(@Param("tenantId") Integer tenantId);

@Query(value = "select count(*) from kwtopics", nativeQuery = true)
List<Object[]> findAllTopicsCount();
int findAllTopicsCount();

@Query(
value = "select count(*) from kwtopics where teamid = :teamIdVar and tenantid = :tenantId",
Expand Down

0 comments on commit c5407b7

Please sign in to comment.