I look at this, very popular page and see that it start with
This page describes Hibernate 3.1.x and code shown here does not work in older versions.
So my question very easy: how to implement behavior like this in newest versions of hibernate (4.1+)? Maybe it exist more elegant decision of lazy initialization problem? Any advice and links are welcome.