• 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

entity state question

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in a application or container managed entity manager with persistenctype = extended, if a entity is deleted, is it detached? if it is dettached, is there a way to reattached it back
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jim li wrote:in a application or container managed entity manager with persistenctype = extended, if a entity is deleted, is it detached? if it is dettached, is there a way to reattached it back



If we go by the LIFE CYCLE of an Entiry Instance then when you delete an entity it goes from 'Managed' State to 'Removed' state (you will use remove methond ).
it does not go to 'Detached ' State.
and again according to the LIFE CYCLE if an Entity is in 'Removed' State you can restore it by again Calling persist method.


I think LIFE CYCLE Should be same regardless of which scope you use(normal or extended)
So i THINK it applies to your question also.

if a entity is deleted, is it detached? No I think it is in Removed state.
f it is dettached, is there a way to reattached it back YES You could have had done that using merge method again but if it would have in DETACHED remember it is in Removed State.

You may try this practically........

 
Friends help you move. Good friends help you move bodies. This tiny ad will help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic