Hibernate Inheritance – Table Per Class Hierarchy (XML Mapping & Annotation)

Java being an Object Oriented Language, it supports one of the most powerful concept “Inheritance“. Object Oriented Systems generally supports both IS-A and HAS-A relationships, whereas Relational Model supports only HAS-A relationship. Hibernate can help you map such kind of entities into the Relational table based on the strategy selected.

Types of Inheritance in Hibernate

Hibernate offers 3 different approaches for mapping this kind of hierarchical classes.

  1. Table per Class hierarchy
  2. Table per Sub-Class hierarchy
  3. Table per Concrete Class hierarchy

[Read more…]

Hibernate One-to-One Bidirectional Mapping Example – Foreign Key(Annotation)

In this article, we will learn how to achieve Hibernate One-to-One Bidirectional Mapping using the JPA Annotations with Foreign Key, in the previous One-To-One Bidirectional Mapping Example we used only the Primary Key. This Annotation approach is just an alternative to the XML mapping which we used in our earlier article Hibernate One-To-One Mapping XML Example with Foreign Key
[Read more…]

Spring Security Tutorial Hello World Example – Using XML Configuration

In this Spring Security Tutorial, we will build a Simple Spring MVC Hello World application integrated with Spring Security features. In this application, we will be dealing with two major security areas Authentication and Authorization.

  • Authentication – It is nothing but validating whether the user is a valid user or not.
  • Authorization –  Deciding whether the particular user is allowed to perform a certain activity in the application or not.

[Read more…]