port handleLazyProxy changes from hibernate3 to hibernate4 module