• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to refresh a collection after new object is added?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Everyone,

I have two entity classes: Centre and User. (One Centre has many Users).

Once I add a new User into the user list of a Centre, it is not in the list retrieved by 'centre.getUserCollection()'.

I guess the object 'centre' is not properly refreshed/updated after the new user has been inserted.

If I use the EntityManager to refresh the centre, the newly added user appears in the list.

Is this the normal way to keep the centre object fresh?
 
X Yang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The puzzle has been solved. I should always ask the Facade for latest/fresh objects after changes.
 
reply
    Bookmark Topic Watch Topic
  • New Topic