incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [21/50] [abbrv] git commit: GenericDao: Add method to find by uuid string including removed entities
Date Sat, 26 Jan 2013 16:21:39 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/e51786a5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e51786a5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e51786a5

Branch: refs/heads/marvin-refactor-phase1
Commit: e51786a595aff6579e3e16d3870b79676757dcbe
Parents: 2c07e11
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Wed Jan 23 14:55:55 2013 -0800
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Thu Jan 24 17:48:36 2013 +0530

----------------------------------------------------------------------
 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/e51786a5/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/e51786a5/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