• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

initialize all properties at once without using annotation fetchType eager

 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this:



When initializing the hobby-instance, I can do it like this:



However, the properties of hobby are not initialized, as the doc says:

"This only ensures intialization of a proxy object or collection; it is not guaranteed that the elements INSIDE the collection will be initialized/materialized."


Is there a method to initialize it full?

When using the default:



then all hobby-properties are initialized correctly. However, I want to initialize in my code in a conditionally way and avoid it to say Hibernate.initialize(property) for every property.
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did it with join-fetch-query, the problem is solved.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic