Advertisement



< Prev
Next >



Hibernate - Entity object and Value Type Object



In our previous article, we introduced you to the concept of Valye Type Object in Hibernate and displayed its use using Annotations in Hibernate. Today, we will explain the concept of Valye Type Object in Hibernate by creating the mapping-resource file with extension hbm.xml, instead of Annotations.

For those who have not read our previous article about Value Type Object, here is the recap.

A Value type object in Hibernate and is different from an Entity object. Entity object is an object of our plain old java class(POJO) Model/Business class, which needs to be persisted in a database using Hibernate, while Value Type object is an object of another class but it is stored as a part of Entity object within a database table.




Entity class v/s Value Type class


Let's suppose, we have two classes Employee_Details and Credentials, where Employee_Details contains the information about the identification number, first name and last name of each employee and Credentials class refers to the information such as skills, number of years of experience and awards received by each employee.



Let's put this example to work to have a better understanding of the concept.




Note :


Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement

Notifications



Please check our latest addition

PYTHON


Advertisement