[hibernate-issues] [Hibernate-JIRA] Reopened: (HHH-2176) DB2 setMaxResults problem in Hibernate 3.1.3
Gail Badner (JIRA)
noreply at atlassian.com
Wed Jun 8 20:49:25 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gail Badner reopened HHH-2176:
------------------------------
This should be backported to 3.6
> 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
> Fix For: 4.0.0.Beta1
>
> 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