[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (HHH-5810) Database MYSQL supports recursive but populate doesn't work
Gail Badner (JIRA)
noreply at atlassian.com
Mon Jan 3 22:52:04 EST 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39474#action_39474 ]
Gail Badner edited comment on HHH-5810 at 1/3/11 9:50 PM:
----------------------------------------------------------
I believe this is a duplicate. Please do some searches to check...
was (Author: gbadner):
I believe this is a duplicate...
> Database MYSQL supports recursive but populate doesn't work
> -----------------------------------------------------------
>
> Key: HHH-5810
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5810
> Project: Hibernate Core
> Issue Type: Task
> Components: query-sql
> Affects Versions: 3.3.0.GA
> Environment: Hibernate 3.3.0 GA, MySQL 5.1.41
> Reporter: Raul Romanillos Llorente
>
> After running on the screen we see that the field_3 field_1 fields have the same value.
> Hibernate has the same value assigned to the fields valueField_1, valueField_2 and valueField_3 and the database are different values.
> Hibernate did not return good results with createSQLQuery (query).
> ...
> String query = "SELECT i.id_route, i.route_name, ii.route_name, iii.route_name,";
> query += " FROM routes i";
> query += " LEFT JOIN routes ii ON i.id_route_parent=i.id_route";
> query += " LEFT JOIN routes iii ON ii.id_route_parent=iii.id_route
> tx = session.getTransaction();
> tx.begin();
> result = session.createSQLQuery(query).list();
> tx.commit();";
> String valueField_0, valueField_1, valueField_2, valueField_3;
> if (result!=null) {
> for (Object obj: result) {
> Object [] cols= (Object []) irObj;
> valueField_0=(cols[0]!=null?cols[0].toString():"");
> valueField_1=(cols[1]!=null?cols[1].toString():"");
> valueField_2=(cols[2]!=null?cols[2].toString():"");
> valueField_3=(cols[3]!=null?cols[3].toString():"");
> System.out.println("field_1:"+valueField_1+"\nfield_2:"+valueField_2+"\nfield_3:"+valueField_3);
> }
> }
--
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