-->
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.  [ 1 post ] 
Author Message
 Post subject: FetchMode + complex composite key
PostPosted: Thu Apr 15, 2010 7:31 am 
Newbie

Joined: Thu Apr 15, 2010 3:36 am
Posts: 1
Hi there,
I am having trouble with criteria.setFetchMode(String s, FetchMode f). Namely, it seems to be ignored if I try to setFetchMode JOIN to an element of the primary key.
Situation is like this:

Code:
public class AAA{
   
@EmbeddedId
private AAAKey aaaKey = new AAAKey();

public static class AAAKey(){
    @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY )
    @JoinColumn(name = "bbb_id", referencedColumnName="bbb_id", nullable = false)
    private BBB bbb;
      
    @Column(name="year", nullable=false)
    private Long year;
}

}

public class BBB{
}

...


essentially, one would think that if I put criteria.setFetchMode("aaaKey.bbb",FetchMode.JOIN), then we'd see an inner
join with the class BBB, but this does not happen. Why not?

Thanks.


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

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.