mirror of https://github.com/apache/cloudstack.git
GenericDao: Add method to find by uuid string including removed entities
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
b335684ec5
commit
03d2c015ae
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -921,6 +921,14 @@ public abstract class GenericDaoBase<T, ID extends Serializable> implements Gene
|
|||
return findOneBy(sc);
|
||||
}
|
||||
|
||||
@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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue