Can I cache a ManyToOne hibernate object without it being lazy loaded?

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2011-01-14T17:32:00Z Indexed on 2011/01/15 12:53 UTC
Read the original article Hit count: 175

Filed under:
|
@ManyToOne
@JoinColumn(name = "play_template_id", table = "team_play_mapping" )
public Play getPlay() {
    return play;
}

public void setPlay( Play play ) {
    this.play = play;
}

By default, this is eager loading. Can I get it so that it will read the play object from a cache without making it lazy loading? Am I correct that eager loading will force it to do a join query and hence no caching?

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about memcached