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.