<<< Prev

Next >>>

Inheritance Mapping

Hibernate Inheritance Mapping : Java is object oriented language and inheritance is one of main functionalities of java. Relation model can implement "is a" and "has a" relationship but hibernate provides us way to implement class hierarchy in a different ways.

For Example:

            Class Mobile



          Class android extends Mobile



If we save android class object. Than Mobile class object will also save in our Database.

There are three ways to implements inheritance in hibernate.

  1. Table Per Hierarchy.
  2. Table Per Concrete class.
  3. Table Per Subclass.