Fix bugs in refactored listTemplates and listIsos API.

This commit is contained in:
Min Chen 2013-04-30 11:31:45 -07:00
parent 7d2565c491
commit bbd5d13213
6 changed files with 9 additions and 6 deletions

View File

@ -720,6 +720,7 @@
<bean id="ancientDataMotionStrategy" class="org.apache.cloudstack.storage.motion.AncientDataMotionStrategy" />
<bean id="storageCacheManagerImpl" class="org.apache.cloudstack.storage.cache.manager.StorageCacheManagerImpl" />
<bean id="storageCacheRandomAllocator" class="org.apache.cloudstack.storage.cache.allocator.StorageCacheRandomAllocator" />
<bean id="xenserverSnapshotStrategy" class="org.apache.cloudstack.storage.snapshot.XenserverSnapshotStrategy" />
<bean id="apiDBUtils" class="com.cloud.api.ApiDBUtils" />
<bean id="apiDiscoveryServiceImpl" class="org.apache.cloudstack.discovery.ApiDiscoveryServiceImpl" />
<bean id="apiDispatcher" class="com.cloud.api.ApiDispatcher" />

View File

@ -65,13 +65,13 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO
snapshotSearch = createSearchBuilder();
snapshotSearch.and("snapshot_id", snapshotSearch.entity().getSnapshotId(), SearchCriteria.Op.EQ);
snapshotSearch.and("store_role", storeSearch.entity().getRole(), SearchCriteria.Op.EQ);
snapshotSearch.and("store_role", snapshotSearch.entity().getRole(), SearchCriteria.Op.EQ);
snapshotSearch.done();
storeSnapshotSearch = createSearchBuilder();
storeSnapshotSearch.and("snapshot_id", storeSnapshotSearch.entity().getSnapshotId(), SearchCriteria.Op.EQ);
storeSnapshotSearch.and("store_id", storeSnapshotSearch.entity().getDataStoreId(), SearchCriteria.Op.EQ);
storeSnapshotSearch.and("store_role", storeSearch.entity().getRole(), SearchCriteria.Op.EQ);
storeSnapshotSearch.and("store_role", storeSnapshotSearch.entity().getRole(), SearchCriteria.Op.EQ);
storeSnapshotSearch.done();
return true;

View File

@ -2535,7 +2535,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
Boolean isAscending = Boolean.parseBoolean(_configDao.getValue("sortkey.algorithm"));
isAscending = (isAscending == null ? true : isAscending);
Filter searchFilter = new Filter(TemplateJoinVO.class, "sort_key", isAscending, startIndex, pageSize);
Filter searchFilter = new Filter(TemplateJoinVO.class, "sortKey", isAscending, startIndex, pageSize);
SearchCriteria<TemplateJoinVO> sc = _templateJoinDao.createSearchCriteria();
// add criteria for project or not
@ -2577,7 +2577,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
}
// add hypervisor criteria
if ( !hypers.isEmpty()){
if ( hypers != null && !hypers.isEmpty()){
String[] relatedHypers = new String[hypers.size()];
for (int i = 0; i < hypers.size(); i++){
relatedHypers[i] = hypers.get(i).toString();

View File

@ -58,7 +58,7 @@ public class ImageStoreJoinDaoImpl extends GenericDaoBase<ImageStoreJoinVO, Long
dsIdSearch.and("id", dsIdSearch.entity().getId(), SearchCriteria.Op.EQ);
dsIdSearch.done();
this._count = "select count(distinct id) from image_data_store_view WHERE ";
this._count = "select count(distinct id) from image_store_view WHERE ";
}

View File

@ -52,7 +52,7 @@ public class ImageStoreJoinVO extends BaseViewVO implements InternalIdentity, Id
@Column(name = "protocol")
private String protocol;
@Column(name = "provider_name", nullable = false)
@Column(name = "image_provider_name", nullable = false)
private String providerName;
@Column(name="scope")

View File

@ -553,6 +553,8 @@ CREATE VIEW `cloud`.`template_view` AS
vm_template.extractable,
vm_template.template_tag,
vm_template.sort_key,
vm_template.removed,
vm_template.enable_sshkey,
source_template.id source_template_id,
source_template.uuid source_template_uuid,
account.id account_id,