[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2548) when "order by" a composit object, which may be null, the result list returns only when the composit objcts not null
Gail Badner (JIRA)
noreply at atlassian.com
Wed Sep 26 16:25:57 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28229 ]
Gail Badner commented on HHH-2548:
----------------------------------
Please attach a runnable test case (Java plus mapping).
> when "order by" a composit object, which may be null, the result list returns only when the composit objcts not null
> --------------------------------------------------------------------------------------------------------------------
>
> Key: HHH-2548
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2548
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.2.3
> Environment: tomcat 5.5, eclipse3.2, jre1.5, postgreSQL8.1, hibernate3 and hibernate3.2
> Reporter: Yu Deng
> Priority: Critical
> Original Estimate: 30 minutes
> Remaining Estimate: 30 minutes
>
> <hibernate-mapping package="com.grapevinecs.ams.domain.perbranch.inv">
> <class name="InvItem">
> <id name="id" column="id">
> <generator class="hilo"/>
> </id>
> ...
> <many-to-one name="transferredDetails"/> <!-- FK: Points to corresponding entry for transferred inventory items -->
> ....
> </class>
> (another mapping file)
> </hibernate-mapping>>
> <hibernate-mapping package="com.grapevinecs.ams.domain.perbranch.inv">
> <class name="InvTransferDetails" >
> <id name="id" column="id">
> <generator class="hilo"/>
> </id>
> <property name="returnedToICBC" type="com.grapevinecs.ams.dao.BooleanInteger" not-null="true"/>
> ...
> </class>
> </hibernate-mapping>
> Probelm:
> 1) The result returns 3000 records ---- select count(*) from InvItem c where upper(c.invType) LIKE '%D%' and c.invSeries.closed = '0' and c.branch =60551 order by c.transferredDetails.returnedToICBC asc, c.stamp asc,c.invNmbr asc
> 2) result List return size 0 by this query --- from InvItem c where upper(c.invType) LIKE '%D%' and c.invSeries.closed = '0' and c.branch =60551 order by c.transferredDetails.returnedToICBC asc, c.stamp asc,c.invNmbr asc
> 1) is correct but 2) is not correct. only when transferredDetails in InvItem not null be returned. in case 2), I have no transferredDetails not null.
> after I excuted the query 2), even I remove "c.transferredDetails.returnedToICBC asc", the result is still return nothing.
--
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