EntityManager: Implement method to search by uuid including removed entities

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-01-23 14:55:26 -08:00
parent 3c335bd883
commit b335684ec5
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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;