Hibernate default fetching strategy…

hi

We all know that the default fetching strategy for hibernate is lazy. But, wait, is it, really ?

As you might have guessed by now, it’s not. Indeed, for @OneToOne and @ManyToOne annotations (and only theses annotations), the default is eager. Funny no ? Oh, I forgot : don’t ask me why, I can just tell it’s the case (from one issue at work, some digging into the topic and this nice topic – which includes links to the doc for the non believers - on the hibernate forum).

Time to think at some way to always ask for explicit fetching strategy for ManyToOne annotations… Maven plugin to the rescue ? We shall see ! :)

++

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>