You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/11/25 09:31:26 UTC
[GitHub] [cloudstack] weizhouapache commented on pull request #5704: engine/schema: fix findActiveAccountById in AccountDaoImpl.java
weizhouapache commented on pull request #5704:
URL: https://github.com/apache/cloudstack/pull/5704#issuecomment-979020367
> @weizhouapache code looks ok, but what is the sense of searching for a bunch of fields _and_ the id. The id is unique so this search makes no sense to me. Do you know how it is used and why it is a bug there?
@DaanHoogland
as I said in description, the issue is with findActiveAccountById
https://github.com/apache/cloudstack/blob/85373e62191ce18b9d968d366661d3e2efa5909d/engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java#L199-L203
this method search records by id, but "id" is not supported in AllFieldsSearch.
therefore the result is same as (id/accountid is ignored)
```
@Override
public Account findActiveAccountById(Long accountId, Long domainId) {
SearchCriteria<AccountVO> sc = AllFieldsSearch.create();
sc.setParameters("domainId", domainId);
return findOneBy(sc);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org