-->
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.  [ 3 posts ] 
Author Message
 Post subject: @Fetch doesn't seem to work
PostPosted: Wed Apr 09, 2014 9:49 am 
Beginner
Beginner

Joined: Sat Jun 24, 2006 7:05 am
Posts: 20
I've the following annotated entity in hibernate 4.3.5.
Looking at the query executed it seems to ignore the @Fetch join annotation and then executes 2 queries.
Any suggestion ?
Tks
Tullio

Code:
@Entity
@Table(name="V41TIPI_EVENTO")
public class V41tipiEvento extends EntityBase<S41tipiEventoPk> {

   private static final long serialVersionUID = 1L;
   
    @Column(name="DESS41")
   private String dess41;
    @Column(name="CGES41")
   private String cges41;
    @ManyToOne
    @Fetch(value = FetchMode.JOIN)
    @JoinColumn(name="cges41", referencedColumnName="cods42")
    private S42gruppiEvento gruppiEvento;


Top
 Profile  
 
 Post subject: Re: @Fetch doesn't seem to work
PostPosted: Wed Apr 09, 2014 2:11 pm 
Newbie

Joined: Mon Apr 07, 2014 10:20 am
Posts: 12
What happens if you change your @ManyToOne to @ManyToOne(fetch = FetchType.EAGER)?


Top
 Profile  
 
 Post subject: Re: @Fetch doesn't seem to work
PostPosted: Thu Apr 10, 2014 3:40 am 
Beginner
Beginner

Joined: Sat Jun 24, 2006 7:05 am
Posts: 20
Nothing, the same problem.
Tks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.