Hibernate 3.6 Tutorial

AddThis Social Bookmark Button

We will explore  the basics of hibernate before we jump on to further exploration

Read more: Hibernate Basics

AddThis Social Bookmark Button

A CRUD operation deals with creating , retriving , updating and deleting from the table, in this tutorial we will see how it is done.,

Read more: CRUD In Hibernate

AddThis Social Bookmark Button

Hibernate provides advanced features, which can let your classes map even if they are in relationship like  composition and inheritance. We discussed composition last tutorial. Joined-subclass is one of the way for achieving inheritance.

Read more: Joined Subclass

AddThis Social Bookmark Button

A component mapping deals with entities involved in has - a relationship.

Read more: Component Mapping

AddThis Social Bookmark Button

In Real world applications it is natural to  have composite keys  to identify a row, which is combination of key  columns.

Read more: Composite Key Mapping

AddThis Social Bookmark Button

This example tells about how to map one-to-one relationship using Hibernate.

Read more: One to One Mapping

AddThis Social Bookmark Button

Many-to-One is another relationship. Here we are describing this relationship through Employee and Dept table.

Read more: Many to One Mapping

AddThis Social Bookmark Button

In this example we are describing one-to-many relation. There are two table one is Faculty and other is Subject.

Read more: One to Many Mapping

AddThis Social Bookmark Button

This mapping tells about many-to-many mapping. There are two tables, one is "Customer" and other is "Policy".

Read more: Many to Many Mapping

AddThis Social Bookmark Button

Hql is just like sql but it is fully object oriented. Insteade of table name we have to write class neme here. And main difference is inheritance,polymerphism all object oriented properties we can define here.

Read more: HQL In Hibernate

AddThis Social Bookmark Button

Named querey is a concept which separate the query from coding section to hbm file with a specific   name. Which we can use by calling its name. It can be reusable.  can be native sql or hql.

Read more: Named Query in Hibernane

AddThis Social Bookmark Button

Criteria query allows us to create and execute object-oriented query. Generally it is alternative to hql. Basically those people , whose don't have sql knowledge, they can write Criteria query.

Read more: Criteria Mapping

AddThis Social Bookmark Button

Here we are using some expression in criteria. Like ename should start with 'Ra' and salary between minsal and maxsal i.e(1000,3000)

Read more: Criteria Expression

AddThis Social Bookmark Button

We can add logical expression in Criteria like

Expression.eq,  Expression.isNotNull,Expression.between,Expression.like etc. In this example we have expressed this thing

Read more: Criteria Logical Exepression