CLOUDSTACK-8592: fix sort order for tariff

This commit is contained in:
Abhinandan Prateek 2015-10-16 09:51:49 +05:30
parent 298924d519
commit 677564f7ee
2 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ public class QuotaTariffDaoImpl extends GenericDaoBase<QuotaTariffVO, Long> impl
final short opendb = TransactionLegacy.currentTxn().getDatabaseId();
List<QuotaTariffVO> result = new ArrayList<>();
try (TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB)) {
final Filter filter = new Filter(QuotaTariffVO.class, "effectiveOn", false, 0L, 1L);
final Filter filter = new Filter(QuotaTariffVO.class, "updatedOn", false, 0L, 1L);
final SearchCriteria<QuotaTariffVO> sc = listAllIncludedUsageType.create();
sc.setParameters("onorbefore", effectiveDate);
sc.setParameters("quotatype", quotaType);
@ -103,7 +103,7 @@ public class QuotaTariffDaoImpl extends GenericDaoBase<QuotaTariffVO, Long> impl
final short opendb = TransactionLegacy.currentTxn().getDatabaseId();
List<QuotaTariffVO> tariffs = new ArrayList<QuotaTariffVO>();
try (TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB)) {
final Filter filter = new Filter(QuotaTariffVO.class, "effectiveOn", false, 0L, 1L);
final Filter filter = new Filter(QuotaTariffVO.class, "updatedOn", false, 0L, 1L);
final SearchCriteria<QuotaTariffVO> sc = listAllIncludedUsageType.create();
sc.setParameters("onorbefore", effectiveDate);
for (Integer quotaType : QuotaTypes.listQuotaTypes().keySet()) {

View File

@ -219,7 +219,7 @@ public class QuotaServiceImpl extends ManagerBase implements QuotaService, Confi
if (_domainDao.isChildDomain(caller.getDomainId(), domainId)) {
Filter filter = new Filter(AccountVO.class, "id", Boolean.FALSE, null, null);
List<AccountVO> accounts = _accountDao.listAccounts(accountName, domainId, filter);
if (accounts.size() > 0) {
if (!accounts.isEmpty()) {
userAccount = accounts.get(0);
}
if (userAccount != null) {