[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3345) "select new" + "join fetch" = "owner of the fetched association was not present in the select list"

Gail Badner (JIRA) noreply at atlassian.com
Thu Jun 12 13:01:33 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30406 ] 

Gail Badner commented on HHH-3345:
----------------------------------

Please attache a runnable test case (Java  + mapping) that reproduces this issue.

> "select new" + "join fetch" = "owner of the fetched association was not present in the select list"
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HHH-3345
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3345
>             Project: Hibernate3
>          Issue Type: Bug
>    Affects Versions: 3.2.4.sp1
>            Reporter: Anthony Ogier
>
> I want to create a List<B>, each B containing an entity with "A" type, and I also want for each A to force fetching of its "C" property.
> public class B {
>   private A a;
>   public B(A a) {
>     this.a = a;
>   }
> }
> @Entity
> public class A {
>   @ManyToOne @JoinColumn
>   private C c;
> // +get/setter ...
> }
> @Entity
> public class C {
>   @Column
>   private String d;
> // +get/setter ...
> // + at OneToMany
> }
> Here is the HQL :
> select new B(a) from A a left join fetch a.c
> I have that message :
> org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list
> When invoking only "from A a left join fetch a.c", all is good and I have ma List<A> with its "C" properties fetched.
> I think there is a little bug here ... or did I forget something ?

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