For lazy loading, hibernate makes proxies. For lazy=true (that is also the default), I want my data access layer and business layer to use this feature. But once the loaded data is send to the presentation layer, i want "Null pointer exception" instead of "LazyInitializationException could not initialize proxy - no Session" if some property is accessed for the DTO/BO that is not initialized. Conceptually, I dont want to define lazy=false in my individual mappings. Is theres some solution which I want or any good alternative approach? Thanks.
|