Hibernate Component Mapping Example Using Annotations
In my previous post we have seen the example of component mapping using hbm.xml, you can traverse my previous post from Component-Mapping example using hbm.xml . Here we are going to show you the example of component mapping using annotation. Once you create a component that component can be re-use by several places. Here is the text I copied from the documentation "A component is a contained object that is persisted as a value type and not an entity reference. The term "component" refers to the object-oriented notion of composition and not to architecture-level components" Here is a project table ER diagram we are using for this post. We will create a component class with ide,os,language,db fields. Tools and Technologies we are using here: JDK 7 Hibernate 4.3.7 MySql 5.1.10 Eclipse Juno 4.2 Maven 3.2 Overview of the Project Structure: Main Objects of this project are: pom.xml hibernate.cfg.xml annotated pojo database Step 1. Create dat...