Object Life-Cycle In Hibernate

Hello friends, I am again in your service with this important blog. In this blog I will explain the various state of hibernate persisting object. In provided image you will see all the states in GUI format which gives you a rough idea. You see there are three state of...

PERFORMING HIBERNATE LOCKING

Hibernate provides two strategies of locking for performing secure read/write operations. Hibernate achieves this by database locking mechanism and abstains locking object in memory. So, basically hibernate locking depends on database for there operations. The two...

Dealing with LazyInitializationException

Hi Guys! I am back with a new Post titled “Dealing with LazyInitializationException”. In Hibernate “lazy initialization” is one of the key feature of Hibernate which allows it to lazily initialize associated properties of an object. For...

Accessing indirect properties using Criteria

Hi Guys! I am back with a new post titled “Accessing indirect properties using Criteria”. In Hibernate Criteria when we try to reference an indirect property of an object(A property that is part of another mapped object) then we get the following...

Using Projections in Hibernate

Hi Guys, I am back with another post titled “Using Projections in Hibernate”. When we deal with large objects(containing multiple attributes) we use Projections to select only a subset of attributes of an object. It helps in avoiding unnecessary column...

Inheritance in Hibernate

Inheritance is one of the biggest mismatch between object oriented model and relational model(SQL based models) because object oriented paradigm supports both Is a(Inheritance) and Has a(Association) relationship. But relational models support only Has a relationship...

Filtering Records using Hibernate Criteria

Hi Guys! I am back with a new blog post titled “Filtering Records using Hibernate Criteria”. I often use Hibernate Criteria in my project whenever a new entity is added and I need to implement certain filters on it. The Hibernate Session provides...