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

Anthony Ogier (JIRA) noreply at atlassian.com
Thu Jun 12 11:35:33 EDT 2008


"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