cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [4/50] git commit: refs/heads/ui-multiple-vlan-ranges - CLOUDSTACK-1179: API searches for names should not be fuzzy. fuzzy search should be done through keyword.
Date Wed, 13 Mar 2013 22:22:08 GMT
CLOUDSTACK-1179: API searches for names should not be fuzzy. fuzzy
search should be done through keyword.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e40ebcce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e40ebcce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e40ebcce

Branch: refs/heads/ui-multiple-vlan-ranges
Commit: e40ebcce8f73c76186a49778af3d7f096403aaec
Parents: 860ea5c
Author: Min Chen <min.chen@citrix.com>
Authored: Fri Mar 8 16:24:54 2013 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Fri Mar 8 16:43:03 2013 -0800

----------------------------------------------------------------------
 .../src/com/cloud/api/query/QueryManagerImpl.java  |    4 ++--
 server/src/com/cloud/user/DomainManagerImpl.java   |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e40ebcce/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 35fe2f3..951d09e 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -1518,7 +1518,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         // pagination
         _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts,
listProjectResourcesCriteria);
 
-        sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
+        sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ);
         sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
         sb.and("volumeType", sb.entity().getVolumeType(), SearchCriteria.Op.LIKE);
         sb.and("instanceId", sb.entity().getVmId(), SearchCriteria.Op.EQ);
@@ -1555,7 +1555,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         }
 
         if (name != null) {
-            sc.setParameters("name", "%" + name + "%");
+            sc.setParameters("name", name);
         }
 
         sc.setParameters("systemUse", 1);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e40ebcce/server/src/com/cloud/user/DomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/DomainManagerImpl.java b/server/src/com/cloud/user/DomainManagerImpl.java
index 9f0ad53..babaed3 100644
--- a/server/src/com/cloud/user/DomainManagerImpl.java
+++ b/server/src/com/cloud/user/DomainManagerImpl.java
@@ -365,7 +365,7 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager,
Dom
 
         SearchBuilder<DomainVO> sb = _domainDao.createSearchBuilder();
         sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
-        sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
+        sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ);
         sb.and("level", sb.entity().getLevel(), SearchCriteria.Op.EQ);
         sb.and("path", sb.entity().getPath(), SearchCriteria.Op.LIKE);
         sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ);
@@ -379,7 +379,7 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager,
Dom
         }
 
         if (domainName != null) {
-            sc.setParameters("name", "%" + domainName + "%");
+            sc.setParameters("name", domainName);
         }
 
         if (level != null) {
@@ -492,7 +492,7 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager,
Dom
 
             if (!domains.isEmpty() && !sameDomain) {
                 InvalidParameterValueException ex = new InvalidParameterValueException("Failed
to update specified domain id with name '" + domainName + "' since it already exists in the
system");
-                ex.addProxyObject(domain, domainId, "domainId");                
+                ex.addProxyObject(domain, domainId, "domainId");
                 throw ex;
             }
         }


Mime
View raw message