When running a pure, native SQL Query, I specify the column order explicitly. The SQL query generated by Hibernate is correct:
Code:
select TREE_NAME, Category_Name, Subcategory_Name, UV_INDEX, QVI_2, Total_Reach, Total_Sample_Size, TG_Reach, TG_Sample_Size, Min_UV_Total, Min_UV_TG, Capped_Min_UV_Index, Disc_MinPerPage, Ad_Supported, TREE_ID, TREE_LEVEL, MV_CAT_ID, Visits, Disc_Visits, PageViews, Disc_PageViews, Duration, Disc_Duration, Min_Page_Channel, Min_Page_Index_Channel, MIN_UV_INDEX from tempTable
The problem is that the result should be returned as such:
Quote:
congress.org, News & Information, Special Interest News, 530.0, 706, 0.0010, 171,0.0053, 48, 7.5733, 13.9212, 130, 0.9877, Y, 197835, Brand, 2147483647, 660, 1822260.0, 5134, 1.36306E7, 6451.0, 1.38004E7, 1.0125, 102.507, 183.82
But it is getting returned to my Object[] as:
Quote:
183.82, 13.9212, 0.9877, 2147483647, 0.0053, 0.0010, Brand, 6451.0, 7.5733, 5134, congress.org, 130, 48, 1.0125, Special Interest News, News & Information, 1822260.0, 171, 102.507, 706, 197835, Y, 530.0, 1.36306E7, 660, 1.38004E7
The ordering seems to be completely random. (But it orders it in this broken manner, consistently). I have added a primary key to the table to see if it would help, I have added aliases to the columns and tables to see if that would make a difference but it seems to have no effect. I have tried searching for a resolution to this, but I have found nothing. Any help would be greatly appreciated.
Using: Hibernate 3.2.4, Mysql 5.075, Kubuntu, 9.04