Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About PersistenceUtil isLoaded in ToyApplication in Enthuware  RSS feed

 
Himai Minh
Ranch Hand
Posts: 1514
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, ranchers,
Do you have the same issue as below when you run ToyApplication provided by Enthuware ?
In the ToyApplication, Item.java,

Why the PersistenceUtil cannot load categories ?
How can I make it load categories?

 
Paul Anilprem
Enthuware Software Support
Ranch Foreman
Posts: 3985
31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just set fetch type to eager in Item.java for categories:

@ManyToMany(fetch=FetchType.EAGER)
private Set<Category> categories;
 
Himai Minh
Ranch Hand
Posts: 1514
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Paul.
Thanks for your reply. It works.
But why the lazy fetch does not work in this case ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!