• 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 ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

ManyToMany inverseJoinColumns side null fields

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
Database table structure is as -

Please take a look at code which works fine -

I can see output of line #1 with list of 2 employees,
But somehow persistence provider do not initialize Employee.officeBranches , so the 'empsOfficeBranches'
on line #2 get initialized to null.
What is the problem with the above code? Why Employee.officeBranches does not get initialized
with list of OfficeBranch after en.refresh(ob) method call on line #0.

Thanks

 
Ranch Hand
Posts: 462
Scala jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try adding fetch=FetchType.EAGER to the @ManyToMany annotations, the default is Lazy I think
reply
    Bookmark Topic Watch Topic
  • New Topic