##
When a domain object gets created, it is in transient state
save() method makes a transient object into persistent object
save() method assigns object identifier and returns it as return value
Actual SQL requests are sent when persistent objects in a session get committed
##
Transient objects do not get committed to the database table
Only persistent objects do get committed to the database table
##
Each session represents a different persistence context
Persistent objects in a session becomes detached objects after the session it belongs to closes
A detached objects still maintains the object identifier that has been assigned before
The difference between transient object and detached object is that the transient object does not have the object identitifer (since it has never been assigned before) while detached object does
merge() takes a detached object as an argument and then returns a new persistent object that contains the same object identifier that the detached object used to have but of course
##
When a domain object gets created, it is in transient state
save() method makes a transient object into persistent object
save() method assigns object identifier and returns it as return value
Actual SQL requests are sent when persistent objects in a session get committed
##
Transient objects do not get committed to the database table
Only persistent objects do get committed to the database table
##
Each session represents a different persistence context
Persistent objects in a session becomes detached objects after the session it belongs to closes
A detached objects still maintains the object identifier that has been assigned before
The difference between transient object and detached object is that the transient object does not have the object identitifer (since it has never been assigned before) while detached object does
merge() takes a detached object as an argument and then returns a new persistent object that contains the same object identifier that the detached object used to have but of course
##
No comments:
Post a Comment