CS-15590 : Conditions are corrected to be similar to other search wrapper usecases

This commit is contained in:
Vijay 2012-07-17 16:56:12 +05:30
parent c826fa295b
commit c755172a3a
2 changed files with 3 additions and 2 deletions

View File

@ -45,6 +45,7 @@ public class ListConditionsCmd extends BaseListAccountResourcesCmd {
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = false, description = "ID of the Condition.")
private Long id;
@IdentityMapper(entityTableName = "counter")
@Parameter(name = ApiConstants.COUNTER_ID, type = CommandType.LONG, required = false, description = "Counter-id of the condition.")
private Long counterId;

View File

@ -1038,11 +1038,11 @@ public class AutoScaleManagerImpl<Type> implements AutoScaleService, Manager {
SearchCriteria<ConditionVO> sc = searchWrapper.buildSearchCriteria();
if (id != null) {
sc.addAnd("id", SearchCriteria.Op.EQ, id);
sc.setParameters("id", id);
}
if (counterId != null) {
sc.addAnd("counterId", SearchCriteria.Op.EQ, counterId);
sc.setParameters("counterId", counterId);
}
return searchWrapper.search();