[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2176) DB2 setMaxResults problem in Hibernate 3.1.3
Strong Liu (JIRA)
noreply at atlassian.com
Thu Mar 4 20:51:47 EST 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Strong Liu updated HHH-2176:
----------------------------
Priority: Major (was: Blocker)
apparently this is not a block
> DB2 setMaxResults problem in Hibernate 3.1.3
> --------------------------------------------
>
> Key: HHH-2176
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2176
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.3
> Environment: DB2 any version
> Hibernate 3.1.3
> JDK 1.5
> Reporter: Winter Lau
> Assignee: Strong Liu
> Attachments: HHH-2176.patch, HHH-2176_2.patch
>
>
> public static List listHotTags(int count){
> Session ssn = getSession();
> String sql = "SELECT tag_name,COUNT(*) FROM dlog_tag GROUP BY tag_name ORDER BY 2 DESC";
> SQLQuery query = ssn.createSQLQuery(sql);
> query.setMaxResults(count);
> List tags = new ArrayList();
> List results = query.list();
> for(int i=0;results!=null && i
> tags.add(((Object[])results.get(i))[0]);
> }
> return tags;
> }
> tags.add(((Object[])results.get(i))[0]); this code work fine in other database, but in DB2 , it return the rownumber, i must change to get the second element of array then it return the correct data.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list