Skip to content

Commit 7960dd4

Browse files
committed
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>
1 parent 1033200 commit 7960dd4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

utils/src/com/cloud/utils/db/GenericDao.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public interface GenericDao<T, ID extends Serializable> {
5656
T findById(ID id, boolean fresh);
5757

5858
// Finds one unique VO using uuid
59-
T findByUuid(ID uuid);
59+
T findByUuid(String uuid);
6060

6161
/**
6262
* @return VO object ready to be used for update. It won't have any fields filled in.

utils/src/com/cloud/utils/db/GenericDaoBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ public T findById(final ID id) {
915915

916916
@Override @DB(txn=false)
917917
@SuppressWarnings("unchecked")
918-
public T findByUuid(final ID uuid) {
918+
public T findByUuid(final String uuid) {
919919
SearchCriteria<T> sc = createSearchCriteria();
920920
sc.addAnd("uuid", SearchCriteria.Op.EQ, uuid);
921921
return findOneBy(sc);

0 commit comments

Comments
 (0)