In this section we will learn about Hibernate Annotations and understand how Hibernate Annotations is simplifying the programming.
The default method of providing the metadata to the Hibernate is the xml file. In the xml file (hibernate.cfg.xml) the database connection information and other configuration information is provided. There is another file Hibernate mapping file (*.hbm.xml) which is used to map the entity with the database table. Sometimes its very tedious method and take a lot of effort to modify the existing file if there is some change in database. Now hibernate provides another way to provide the mapping metadata to the application. It is known as Hibernate annotations and it based on the Java 5 annotations. So, to use Hibernate Annotations you should have Java 5 and Hibernate 3 or above.
Bothe Hibernate Annotations and JPA Annotations are versioned and released from the Hibernate Core 3.5.
Here are the benefits of using Hibernate annotations:
Here are the list of Hibernate Annotations classes:
We have given very good tutorial on Hibernate annotations, you can learn the basics and advance concepts of using Hibernate tutorial.
Read more at Hibernate Annotations Tutorial section.