incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [32/50] [abbrv] git commit: EntityManager: Implement method to search by uuid including removed entities
Date Fri, 25 Jan 2013 03:31:46 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/b335684e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b335684e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b335684e

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

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