[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2257) Query.iterate() results differ from Query.list() 2

Steve Ebersole (JIRA) noreply at atlassian.com
Tue Dec 5 13:39:04 EST 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2257?page=comments#action_25564 ] 

Steve Ebersole commented on HHH-2257:
-------------------------------------

Can you confirm that p.client refers to a many-to-one or one-to-one association?  

In the future, the appropriate mappings are usually needed to correctly diagnose problems.  At the very least I need the context of the issue.

> Query.iterate() results differ from Query.list() 2
> --------------------------------------------------
>
>          Key: HHH-2257
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2257
>      Project: Hibernate3
>         Type: Bug

>   Components: query-hql
>     Versions: 3.2.0.ga
>  Environment: Hibernate 3.2.0 ga, ASTQueryTranslator,
> Sun Java 1.5.0-06, Windows XP
>     Reporter: Milan Pecko
>     Assignee: Steve Ebersole
>     Priority: Minor
>      Fix For: 3.2.2

>
>
> I saw the problem with the same description(HHH-1946) but my problem occurs with hibernate 2.1.8 too.
> The problem is a differnet number of results:
> HQL : "select p.id,p.client from Portfolio as p"
> SQL produced by list() :
> "select portfolio0_.portfolioId as col_0_0_, portfolio0_.clientId as col_1_0_, subject1_.subjectId as subjectId194_, subject1_.name as name194_,... from PORTFOLIO_TBL portfolio0_ inner join SUBJECT_TBL subject1_ on portfolio0_.clientId=subject1_.subjectId"
> SQL produced by iterate() :
>  "select portfolio0_.portfolioId as col_0_0_, portfolio0_.clientId as col_1_0_ from PORTFOLIO_TBL portfolio0_"
> when i changed HQL to : "select p.id,p.client.id from Portfolio as p"
> the number of results is the same.
> both functions produce the same SQL:"select portfolio0_.portfolioId as col_0_0_, portfolio0_.clientId as col_1_0_ from PORTFOLIO_TBL portfolio0_"
> I dont know what resultset is correct "ids includes ids with client equals to null" or "ids with client only" but i think the number of result should be tha same for same HQL.

-- 
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