• 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

nulling managed entities

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, this should be pretty basic but was unable to find an answer via google.

What happens when you null an entity when using an Extended PC? I would think that it does not alter the underlying data model at all and should just act like any other pojo. In order to affect the data model you would have to call an EntityManager method like .remove(), correct?

It is just confusing to me because you can update an entity just by calling setter methods without calling any entity manager methods.

Example



The underlying data row for foo with id = "SomeId" should be unchanged?

I would test this myself but do not have the facilities to do so at the moment.

Thanks.
[ July 11, 2007: Message edited by: Brian Smith ]
 
Brian Smith
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was able to test this today, for anyone who cares...

When a managed entity is set to null, the underlying data model does not change. The entity becomes detached and dereferenced like any other object.
 
I'm full of tinier men! And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic