Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

About PersistenceUtil isLoaded in ToyApplication in Enthuware

 
Ranch Foreman
Posts: 1897
12
  • 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?

 
Enthuware Software Support
Posts: 4427
41
  • 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 Foreman
Posts: 1897
12
  • 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 ?
 
It's exactly the same and completely different as this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic