-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: how to get a list String objects using sql-query
PostPosted: Thu Jul 13, 2006 10:31 am 
Newbie

Joined: Thu Jul 13, 2006 10:22 am
Posts: 1
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();
}
});
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.