Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Hibernate - Lazy Init Practical?

Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Initially I thought Lazy Initializtion sounded like a nice feature, but now I believe it is not very practical.
I agree that not loading an entire parent/child relational tree is a great idea, but should not the developer explicitly code when the children elements are loading instead of implicitly having Hibernate do this?
Say I have an Order and OrderItems bean. If I load the Order, forward to the JSP and then display OrderItems for that Order in the JSP, is that not very much like putting the SQL in the JSP? I understand that a call to initialize() will force Hibernate to load the child Collection, I guess I just wish this was required instead of optional.
Any other opinions?
    Bookmark Topic Watch Topic
  • New Topic