Showing posts with label Persistent. Show all posts
Showing posts with label Persistent. Show all posts

Wednesday, October 21, 2015

Hibernate Transient + Persistent + Detached Objects

Transient Object :
One newly created object of POJO class without having any relation with the database, means
never persistent, not associated with any Session object.

Persistent Object:
An object of a POJO class having relation with the database, associated with a unique Session
object

Detached Object:
An object of a POJO class Previously having relation with the database [persistent ], now not
associated with any Session object

Hibernate Object's Transient & Persistent states


Whenever an object of a POJO class is created then it will be in the Transient state
An object in a Transient state doesn’t represent any row of the database,

Means it is not associated with any Session object, No relation with the database, it is just a
normal object

 If we modify the data of a POJO class object, when it is in transient state then it doesn’t effect
on the database table

When the object is in persistent state, then it represent one row of the database,

In persistent state object is having associated with the unique Session

If we want to move an object from persistent to detached state, then we need to do either
close that session or need to clear the cache of the session

If we want to move an object from persistent state into transient state then we need to delete
that object permanently from the database

Scrum and Scrum master

Scrum  Scrum is a framework which helps a team to work together.  It is like a rugby team (the scrum name comes from rugby game). Scrum enco...