-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Fetching strategy for eager fetch
PostPosted: Wed Feb 22, 2006 10:25 am 
Newbie

Joined: Tue Mar 09, 2004 11:17 pm
Posts: 8
Hibernate version:
Hibernate 3.1.2, Hibernate-Annotations 3.1beta8

I'm a little confused about the strategy used to fetch a single-ended association. For example, I have this mapping:

Code:
@Entity
@Table(name="STAFF_MEMBERS")
public class MutableStaffMember implements StaffMember {
...
    @ManyToOne(targetEntity=MutableRole.class, fetch=FetchType.EAGER)
    @JoinColumn(name="ROLE_TYPE_ID", nullable=false)
    public Role getRole() {
        return role;
    }
}


When retrieving a list of StaffMember with this HQL query:

Code:
FROM MutableStaffMember AS msf WHERE msf.role MEMBER OF MutablePhoenixRole


I see on the log that all roles are fetched using SELECT. When using mapping files, we have the outer-join="true|false" option to choose the fetch strategy, but AFAIK there's no way to do so with annotations.
I know the performance issue of the SELECT fetching can be solved with second-level cache, but is there any way to force the fetching strategy using annotations?

Thanks,
Alex.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 11:09 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Do
Code:
ROM MutableStaffMember AS msf join fetch msf.role r WHERE r MEMBER OF MutablePhoenixRole


outer-join has been deprecated long time ago and has never ever influenced HQL queries

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.