incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [21/31] git commit: utils: Fix getByUuid to accept string arg, it's not gonna be anything else
Date Sat, 12 Jan 2013 14:09:05 GMT
utils: Fix getByUuid to accept string arg, it's not gonna be anything else

Due to generic programming, most classes declare Daos with ID as Long, so they
get the getUuid(Long) definition, it has to be getUuid(String), uuid is not
gonna be anything else. Fix GenericDaoBase and GenericDao.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


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

Branch: refs/heads/javelin
Commit: 7960dd429b2d59382845f664a81c72e4024442b5
Parents: 1033200
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Fri Jan 11 14:03:05 2013 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Fri Jan 11 18:44:19 2013 -0800

----------------------------------------------------------------------
 utils/src/com/cloud/utils/db/GenericDao.java     |    2 +-
 utils/src/com/cloud/utils/db/GenericDaoBase.java |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7960dd42/utils/src/com/cloud/utils/db/GenericDao.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/db/GenericDao.java b/utils/src/com/cloud/utils/db/GenericDao.java
index 2fae1af..15d04b7 100755
--- a/utils/src/com/cloud/utils/db/GenericDao.java
+++ b/utils/src/com/cloud/utils/db/GenericDao.java
@@ -56,7 +56,7 @@ public interface GenericDao<T, ID extends Serializable> {
     T findById(ID id, boolean fresh);
 
     // Finds one unique VO using uuid
-    T findByUuid(ID uuid);
+    T findByUuid(String uuid);
     
     /**
      * @return VO object ready to be used for update.  It won't have any fields filled in.

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7960dd42/utils/src/com/cloud/utils/db/GenericDaoBase.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/db/GenericDaoBase.java b/utils/src/com/cloud/utils/db/GenericDaoBase.java
index 92e9e1c..880e9de 100755
--- a/utils/src/com/cloud/utils/db/GenericDaoBase.java
+++ b/utils/src/com/cloud/utils/db/GenericDaoBase.java
@@ -915,7 +915,7 @@ public abstract class GenericDaoBase<T, ID extends Serializable>
implements Gene
 
     @Override @DB(txn=false)
     @SuppressWarnings("unchecked")
-    public T findByUuid(final ID uuid) {
+    public T findByUuid(final String uuid) {
         SearchCriteria<T> sc = createSearchCriteria();
         sc.addAnd("uuid", SearchCriteria.Op.EQ, uuid);
         return findOneBy(sc);


Mime
View raw message