About Question enthuware.oce-jpad.v6.2.504 :
Moderator: admin
About Question enthuware.oce-jpad.v6.2.504 :
What's the difference of a new entity and a detached entity ? If for example the id isn't set as generated, it is written explicitly and the new entity has an Id set. How does he make the difference ?
-
- Posts: 1
- Joined: Mon Jan 07, 2013 3:09 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.504 :
• A new entity instance has no persistent identity, and is not yet associated with a persistence context.
• A detached entity instance is an instance with a persistent identity that is not (or no longer) associated with a persistence context.
Sect 3.2 of JSR317 Specification
Object identity does not equal Persistent identity
• A detached entity instance is an instance with a persistent identity that is not (or no longer) associated with a persistence context.
Sect 3.2 of JSR317 Specification
Object identity does not equal Persistent identity
-
- Posts: 124
- Joined: Wed Feb 12, 2014 2:44 am
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.504 :
Hello ,
Regarding option two "If entityObject is already removed, IllegalStateException will be thrown."
I can't understand what is the difference between remove and detach , I think removing entity instance make it detached (Un managed by the PC).
Please explain
Regarding option two "If entityObject is already removed, IllegalStateException will be thrown."
I can't understand what is the difference between remove and detach , I think removing entity instance make it detached (Un managed by the PC).
Please explain
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.504 :
Removing an entity means you are removing the corresponding data from the database. Detaching it means the instance is not managed anymore by the persistence context. Detaching doesn't affect the database.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 30 guests