Category Archives: Hibernate

Dirty checking in Hibernate.

In this it checks that the object state is changed or not. If it is changed, it automatically calls the update method. If commit method is called, In such case state will be updated automatically. This process is called automatic dirty checking. In this process we have changed employee object and commit the transaction, so Continue Reading…

Hibernate object states

There are three types of Hibernate object states. 1.Transient state: An object is in transient state if it is just created and not associated with session. Example : Employee e1=new Employee(); e1.setId(115); e1.setFirstName(“Rahul”); e1.setLastName(“Thakur”); 2.Persistent state: An object is in persistent state if session is opened and you saved the instance of the object or Continue Reading…