[Building Sakai] generic DAO question
Jim Eng
jimeng at umich.edu
Thu Feb 18 12:55:29 PST 2010
Hi Aaron,
I have an object of type org.sakaiproject.genericdao.api.search.Search
that expresses a set of Restrictions. I would like to do a query that
gets the set of values for a particular property from the set of
things selected by this Search. It looks to me like I may need to
implement a special method in my project's DAO that would turn the
Search object into part of an HQL statement to select the unique
values for the property where the Restrictions of the search are
honored. Does that sound right? Or is there some way to use the
search object directly?
To give you an idea of what I'm looking at, I think the HQL might look
something like this:
select item.importOrderId from EvalmonitorItem item where
item.createdDate < 'yyyy-mm-dd' and item.entityType == 'EvalTemplate'
group by item.importOrderId
where the Search object has two Restrictions (one for "createdDate"
and one for "entityType"). But I don't know whether this is correct
HQL and whether it eliminates duplicate values (as I'd like).
Any suggestions?
Thanks.
Jim
More information about the sakai-dev
mailing list