cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [9/42] git commit: refs/heads/marvin-refactor - EntityManager: Implement method to search by uuid including removed entities
Date Fri, 01 Mar 2013 10:06:31 GMT
EntityManager: Implement method to search by uuid 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/2c07e114
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/2c07e114
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/2c07e114

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

----------------------------------------------------------------------
 api/src/com/cloud/dao/EntityManager.java        |    9 +++++++++
 server/src/com/cloud/dao/EntityManagerImpl.java |    7 +++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2c07e114/api/src/com/cloud/dao/EntityManager.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/dao/EntityManager.java b/api/src/com/cloud/dao/EntityManager.java
index 4e4b9c2..b8fdaa7 100644
--- a/api/src/com/cloud/dao/EntityManager.java
+++ b/api/src/com/cloud/dao/EntityManager.java
@@ -48,6 +48,15 @@ public interface EntityManager {
     public <T> T findByUuid(Class<T> entityType, String uuid);
 
     /**
+     * Finds a unique entity by uuid string
+     * @param <T> entity class
+     * @param entityType type of entity you're looking for.
+     * @param uuid the unique id
+     * @return T if found, null if not.
+     */
+    public <T> T findByUuidIncludingRemoved(Class<T> entityType, String uuid);
+
+    /**
      * Finds an entity by external id which is always String
      * @param <T> entity class
      * @param entityType type of entity you're looking for.

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2c07e114/server/src/com/cloud/dao/EntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/dao/EntityManagerImpl.java b/server/src/com/cloud/dao/EntityManagerImpl.java
index 2eee445..1d88192 100644
--- a/server/src/com/cloud/dao/EntityManagerImpl.java
+++ b/server/src/com/cloud/dao/EntityManagerImpl.java
@@ -52,6 +52,13 @@ public class EntityManagerImpl implements EntityManager, Manager {
     }
 
     @Override
+    public <T> T findByUuidIncludingRemoved(Class<T> entityType, String uuid)
{
+        // Finds and returns a unique VO using uuid, null if entity not found in db
+        GenericDao<? extends T, String> dao = (GenericDao<? extends T, String>)GenericDaoBase.getDao(entityType);
+        return dao.findByUuidIncludingRemoved(uuid);
+    }
+
+    @Override
     public <T> T findByXId(Class<T> entityType, String xid) {
         return null;
     }


Mime
View raw message