Hibernate Locking

Introduction Locking refers to a mechanism taken for granted in a relational database to prevent any modification to the data between the time the data are read and the time the data are used. There are mainly two types of locking strategy available – optimistic and pessimistic

JSF 2, Spring 4, Hibernate 4 and Maven Integration

In this tutorial I will show you how to integrate JSF 2, Spring 4, Hibernate 4 and Maven. In the previous example Spring 3, JSF 2 and Hibernate 3 integration example , I have shown how to integrate JSF 2, Spring 3 and Hibernate 3 but I have not used maven there. For this tutorial we will create maven based…

Struts 2, Spring 4, Hibernate 4 and Maven Integration

In this tutorial I will show you how to integrate Struts 2, Spring 4, Hibernate 4 and Maven. In the previous example Integrate Spring 3, Struts 2 and Hibernate 3 , I have shown how to integrate Struts 2, Spring 3 and Hibernate 3 but I have not used maven there. For this tutorial we will create maven based web…

evict() Method in Hibernate

Introduction Here I am going to show you an example on evict() method in Hibernate. The method evict() removes a single object from Session cache in ORM (Object Relationship Mapping) framework Hibernate. So before you call evict() the object should be there in the Session cache. Therefore if you save the object first time, you have to save the object…

Spring JPA Bidirectional ManyToMany Association Without Join Entity

Introduction Here I am creating an example on how bidirectional many-to-many association without join entity works in entity relationships. I will use SPring Data JPA framework to build this example. In bidirectional association, it will have the navigation in both directions, i.e, both side of the association will have the reference to the other side. The both side of the…

Bidirectional One-To-One Relationship with Join Tables in Hibernate

In bidirectional association, we will have navigation in both direction, i.e, both side of the association will have the reference to the other side. The both side of the association will implement one of the collection interfaces, if it has the reference to the other entity. In one to one relationship, one source object can have relationship with only one…

Bidirectional One-To-Many/Many-To-One Relationship using Join Tables in Hibernate

In bidirectional association, we will have navigation in both direction, i.e, both side of the association will have the reference to the other side. The both side of the association will implement one of the collection interfaces, if it has the reference to the other entity. In one to many or many to one relationship, one source object can have…

Unidirectional Many-To-Many Relationship with Join Tables in Hibernate

In unidirectional association, we will have navigation only in one direction, i.e, only one side of the association will have the reference to the other side. The one side of the association will implement one of the collection interfaces, if it has the reference to the other entity. In many to many relationship, multiple target objects can have relationship with…

Unidirectional One-To-One Relationship with Join Tables in Hibernate

In unidirectional association, we will have navigation only in one direction, i.e, only one side of the association will have the reference to the other side. The one side of the association will implement one of the collection interfaces, if it has the reference to the other entity. In one to one relationship, single target object can have relationship with…

Unidirectional Many-To-One Relationship with Join Tables in Hibernate

In unidirectional association, we will have navigation only in one direction, i.e, only one side of the association will have the reference to the other side. The one side of the association will implement one of the collection interfaces, if it has the reference to the other entity. In many to one relationship, multiple target objects can have relationship with…