• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About PersistenceUtil isLoaded in ToyApplication in Enthuware

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • 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 Hand
Posts: 3820
10
  • 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: 1361
7
  • 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