In simple terms, the mapping defines how an entity class of Object-Oriented paradigm will look like in a relational database table i.e. mapping is nothing but a translation of the Object model into the Data model.
In Hibernate, mapping can be done using
- XML File
- Annotation
In this section we'll discuss how mapping is done in Hibernate in detail with examples.In these examples i will be mostly using the Annotations for mapping instead of the XML file.