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:
Rohit Yadav 2013-01-11 14:03:05 -08:00
parent 1033200b0b
commit 7960dd429b
2 changed files with 2 additions and 2 deletions

View File

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

View File

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