incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [33/50] [abbrv] git commit: GenericDao: Add method to find by uuid string including removed entities
Date Fri, 25 Jan 2013 03:31:46 GMT
GenericDao: Add method to find by uuid string including removed entities

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/03d2c015
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/03d2c015
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/03d2c015

Branch: refs/heads/javelin
Commit: 03d2c015ae70ff0f50adeb9551feca8d27752321
Parents: b335684
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Wed Jan 23 14:55:55 2013 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Wed Jan 23 14:57:41 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/03d2c015/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 15d04b7..31a25fd 100755
--- a/utils/src/com/cloud/utils/db/GenericDao.java
+++ b/utils/src/com/cloud/utils/db/GenericDao.java
@@ -57,6 +57,9 @@ public interface GenericDao<T, ID extends Serializable> {
 
     // Finds one unique VO using uuid
     T findByUuid(String uuid);
+
+    // Finds one unique VO using uuid including removed entities
+    T findByUuidIncludingRemoved(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/03d2c015/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 880e9de..0d73b90 100755
--- a/utils/src/com/cloud/utils/db/GenericDaoBase.java
+++ b/utils/src/com/cloud/utils/db/GenericDaoBase.java
@@ -922,6 +922,14 @@ public abstract class GenericDaoBase<T, ID extends Serializable>
implements Gene
     }
 
     @Override @DB(txn=false)
+    @SuppressWarnings("unchecked")
+    public T findByUuidIncludingRemoved(final String uuid) {
+        SearchCriteria<T> sc = createSearchCriteria();
+        sc.addAnd("uuid", SearchCriteria.Op.EQ, uuid);
+        return findOneIncludingRemovedBy(sc);
+    }
+
+    @Override @DB(txn=false)
     public T findByIdIncludingRemoved(ID id) {
         return findById(id, true, null);
     }


Mime
View raw message