mirror of https://github.com/apache/cloudstack.git
EntityManager: Implement method to search by uuid including removed entities
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
3c335bd883
commit
b335684ec5
|
|
@ -47,6 +47,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
|
||||
|
|
|
|||
|
|
@ -51,6 +51,13 @@ public class EntityManagerImpl implements EntityManager, Manager {
|
|||
return dao.findByUuid(uuid);
|
||||
}
|
||||
|
||||
@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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue