Skip to content

Commit 073a9c0

Browse files
author
Nicole Schmidt
committed
Change listBy to findOneBy
1 parent 352e9c3 commit 073a9c0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

engine/schema/src/main/java/org/apache/cloudstack/acl/dao/ApiKeyPairDaoImpl.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ public ApiKeyPairVO getLastApiKeyCreatedByUser(Long userId) {
7272
sc.setParameters("userId", String.valueOf(userId));
7373
}
7474
final Filter searchBySorted = new Filter(ApiKeyPairVO.class, "id", false, null, null);
75-
final List<ApiKeyPairVO> apiKeyPairVOList = listBy(sc, searchBySorted);
76-
if (CollectionUtils.isEmpty(apiKeyPairVOList)) {
77-
return null;
78-
}
79-
return apiKeyPairVOList.get(0);
75+
return findOneBy(sc, searchBySorted);
8076
}
8177

8278
public Pair<List<ApiKeyPairVO>, Integer> listByUserIdsPaginated(List<Long> userIds, ListUserKeysCmd cmd) {

0 commit comments

Comments
 (0)