Hi,
Below one is my query.
This will return the list of "univid" , I mean list of string objects.
But I am not to get as list of String objects, without using class attribute in<return >. Here is it neccessary to create the Object and mapping xml to get the list of String. ? Are there any other solutions?
Please guide me.
<sql-query callable="false" name="FeedbackAssignmentSetDAO.GET_RECEPIENT_HAVING_MIN_PROVIDERS_FOR_GROUP">
<return alias="recepient" >
</return>
<![CDATA[SELECT TOP :topItems recipient_univid AS {recepient.univid}
FROM Feedback_Assignment_set WHERE group_id = (:groupId)
group By recipient_univid
ORDER BY COUNT(provider_univid)
]]>
</sql-query>
---
Following is my calling method
public Integer getNoOfRecipientsForParticipant(final Integer surveyId, final String univid) {
return (Integer) getHibernateTemplate().execute(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Query query = session
.getNamedQuery("FeedbackAssignmentSetDAO.GET_NUMBER_OF_RECIPIENTS_FOR_PROVIDER");
query.setInteger("surveyid", surveyId.intValue());
query.setString("univid",univid);
return query.uniqueResult();
}
});
}
|