quota: though default value for quota_calculated is 0, the usage server

makes it null while entering usage entries. Flipping the condition so
as to acocunt for that.
This commit is contained in:
Abhinandan Prateek 2015-08-07 10:12:35 +05:30
parent 722805e418
commit 298924d519
2 changed files with 2 additions and 3 deletions

View File

@ -104,7 +104,7 @@ public class UsageVO implements Usage, InternalIdentity {
private Date endDate = null;
@Column(name = "quota_calculated")
private Integer quotaCalculated = null;
private Integer quotaCalculated = 0;
public Integer getQuotaCalculated() {
return quotaCalculated;

View File

@ -470,8 +470,7 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
if (domainId != -1) {
sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId);
}
sc.addAnd("quotaCalculated", SearchCriteria.Op.NULL);
sc.addOr("quotaCalculated", SearchCriteria.Op.EQ, 0);
sc.addAnd("quotaCalculated", SearchCriteria.Op.NEQ, 1);
if (s_logger.isDebugEnabled()){
s_logger.debug("Getting usage records" + usageFilter.getOrderBy());
}