From: <no...@at...> - 2005-06-07 22:29:34
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-594 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-594 Summary: order-by mapping for collections overrides order by in HQL Type: Bug Status: Unassigned Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Versions: 3.0.4 Assignee: Reporter: Jim Reed Created: Tue, 7 Jun 2005 5:29 PM Updated: Tue, 7 Jun 2005 5:29 PM Environment: Hibernate v3.0.4, Oracle 8i Description: In Hibernate v2.1 if you included an order-by in the mapping for a collection, that order by would automatically be concatenated onto any order by clause in your HQL. This allows you to sort your list of Hibernate objects and also sort the collections within those objects. In Hibernate v3.0, however, the order-by clause in the mapping for a collection completely overrides an order by for your HQL. Example: Mapping file: <hibernate-mapping package="com.mycompany.hibernate"> <class name="Client" table="CLIENT"> <id column="CLIENT_ID" name="id" type="integer" > <generator class="vm" /> </id> <property column="NAME" length="255" name="name" not-null="true" type="string" /> <set name="contactSet" inverse="true" lazy="true" order-by="LAST_NAME asc" > <key column="CLIENT_ID" /> <one-to-many class="Contact" /> </set> </class> </hibernate-mapping> HQL: from com.mycompany.hibernate.Client c, c.contactSet cs order by c.name Hibernate v2.1 SQL: select c1.name,c2.first_name,c2.lastname from client c1, contact c2 order by c1.name, c2.last_name Hibernate v3.0 SQL: select c1.name,c2.first_name,c2.lastname from client c1, contact c2 order by c2.last_name --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-06-08 02:07:36
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 7 Jun 2005 9:06 PM Fixed problem, HB3 parser now behaves same as HB2 parser. Note that the query posted by user was incorrect HQL syntax, however the problem did affect queries with left join fetch. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-594 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-594 Summary: order-by mapping for collections overrides order by in HQL Type: Bug Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Fix Fors: 3.0.6 Versions: 3.0.4 Assignee: Gavin King Reporter: Jim Reed Created: Tue, 7 Jun 2005 5:29 PM Updated: Tue, 7 Jun 2005 9:06 PM Environment: Hibernate v3.0.4, Oracle 8i Description: In Hibernate v2.1 if you included an order-by in the mapping for a collection, that order by would automatically be concatenated onto any order by clause in your HQL. This allows you to sort your list of Hibernate objects and also sort the collections within those objects. In Hibernate v3.0, however, the order-by clause in the mapping for a collection completely overrides an order by for your HQL. Example: Mapping file: <hibernate-mapping package="com.mycompany.hibernate"> <class name="Client" table="CLIENT"> <id column="CLIENT_ID" name="id" type="integer" > <generator class="vm" /> </id> <property column="NAME" length="255" name="name" not-null="true" type="string" /> <set name="contactSet" inverse="true" lazy="true" order-by="LAST_NAME asc" > <key column="CLIENT_ID" /> <one-to-many class="Contact" /> </set> </class> </hibernate-mapping> HQL: from com.mycompany.hibernate.Client c, c.contactSet cs order by c.name Hibernate v2.1 SQL: select c1.name,c2.first_name,c2.lastname from client c1, contact c2 order by c1.name, c2.last_name Hibernate v3.0 SQL: select c1.name,c2.first_name,c2.lastname from client c1, contact c2 order by c2.last_name --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2005-07-20 20:08:52
|
The following issue has been updated: Updater: Steve Ebersole (mailto:st...@hi...) Date: Wed, 20 Jul 2005 3:07 PM Changes: Fix Version changed to 3.1 beta 1 Fix Version changed from 3.0.6 --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/browse/HHH-594?page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-594 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-594 Summary: order-by mapping for collections overrides order by in HQL Type: Bug Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Fix Fors: 3.1 beta 1 Versions: 3.0.4 Assignee: Gavin King Reporter: Jim Reed Created: Tue, 7 Jun 2005 5:29 PM Updated: Wed, 20 Jul 2005 3:07 PM Environment: Hibernate v3.0.4, Oracle 8i Description: In Hibernate v2.1 if you included an order-by in the mapping for a collection, that order by would automatically be concatenated onto any order by clause in your HQL. This allows you to sort your list of Hibernate objects and also sort the collections within those objects. In Hibernate v3.0, however, the order-by clause in the mapping for a collection completely overrides an order by for your HQL. Example: Mapping file: <hibernate-mapping package="com.mycompany.hibernate"> <class name="Client" table="CLIENT"> <id column="CLIENT_ID" name="id" type="integer" > <generator class="vm" /> </id> <property column="NAME" length="255" name="name" not-null="true" type="string" /> <set name="contactSet" inverse="true" lazy="true" order-by="LAST_NAME asc" > <key column="CLIENT_ID" /> <one-to-many class="Contact" /> </set> </class> </hibernate-mapping> HQL: from com.mycompany.hibernate.Client c, c.contactSet cs order by c.name Hibernate v2.1 SQL: select c1.name,c2.first_name,c2.lastname from client c1, contact c2 order by c1.name, c2.last_name Hibernate v3.0 SQL: select c1.name,c2.first_name,c2.lastname from client c1, contact c2 order by c2.last_name --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: Nguyen H. G. (JIRA) <no...@at...> - 2006-07-21 07:40:16
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-594?page=comments#action_23712 ] Nguyen Hau Giang commented on HHH-594: -------------------------------------- I met the same problem when querying by Criteria with join-fetch or left-join-alias. Please see HHH-1928 > order-by mapping for collections overrides order by in HQL > ---------------------------------------------------------- > > Key: HHH-594 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-594 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.0.4 > Environment: Hibernate v3.0.4, Oracle 8i > Reporter: Jim Reed > Assignee: Gavin King > Fix For: 3.1 beta 1 > > > In Hibernate v2.1 if you included an order-by in the mapping for a collection, that order by would automatically be concatenated onto any order by clause in your HQL. This allows you to sort your list of Hibernate objects and also sort the collections within those objects. In Hibernate v3.0, however, the order-by clause in the mapping for a collection completely overrides an order by for your HQL. > Example: > Mapping file: > <hibernate-mapping package="com.mycompany.hibernate"> > <class name="Client" table="CLIENT"> > <id > column="CLIENT_ID" > name="id" > type="integer" > > > <generator class="vm" /> > </id> > <property > column="NAME" > length="255" > name="name" > not-null="true" > type="string" > /> > <set > name="contactSet" > inverse="true" > lazy="true" > order-by="LAST_NAME asc" > > > <key column="CLIENT_ID" /> > <one-to-many class="Contact" /> > </set> > </class> > </hibernate-mapping> > HQL: > from com.mycompany.hibernate.Client c, c.contactSet cs > order by c.name > Hibernate v2.1 SQL: > select c1.name,c2.first_name,c2.lastname > from client c1, contact c2 > order by c1.name, c2.last_name > Hibernate v3.0 SQL: > select c1.name,c2.first_name,c2.lastname > from client c1, contact c2 > order by c2.last_name -- 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 |