mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
utils: Fix getByUuid to accept string arg, it's not gonna be anything else
Due to generic programming, most classes declare Daos with ID as Long, so they get the getUuid(Long) definition, it has to be getUuid(String), uuid is not gonna be anything else. Fix GenericDaoBase and GenericDao. Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
1033200b0b
commit
7960dd429b
@ -56,7 +56,7 @@ public interface GenericDao<T, ID extends Serializable> {
|
||||
T findById(ID id, boolean fresh);
|
||||
|
||||
// Finds one unique VO using uuid
|
||||
T findByUuid(ID uuid);
|
||||
T findByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* @return VO object ready to be used for update. It won't have any fields filled in.
|
||||
|
||||
@ -915,7 +915,7 @@ public abstract class GenericDaoBase<T, ID extends Serializable> implements Gene
|
||||
|
||||
@Override @DB(txn=false)
|
||||
@SuppressWarnings("unchecked")
|
||||
public T findByUuid(final ID uuid) {
|
||||
public T findByUuid(final String uuid) {
|
||||
SearchCriteria<T> sc = createSearchCriteria();
|
||||
sc.addAnd("uuid", SearchCriteria.Op.EQ, uuid);
|
||||
return findOneBy(sc);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user