Monday, March 6, 2017

What is the use of annotations in hibernates?

What is the use of annotations in hibernates?


Lets see the uses and benefits of Hibernate annotations:

In the Hibernate version 2.5 or below there was only one method of creating the Java class to database mapping information. And this was done through the xml files. Very easy for programmer as programmer can define mapping in the same POJO file and there are very less chances of error.

Programmer always loves the annotations way of programming due to simplicity.

So, it was not easy method. Developers needs to work on Java class and then on xml file for mapping.


After introduction of annotation in Java 5, Hibernate adopted annotation method for mapping. In this case developer provides mapping information in the Java class itself and its very easy method.

Check tutorial: Hibernate 4 Annotations Tutorial 

More tutorials of Hibernate:

  1. Complete Hibernate 3.0 and Hibernate 4 Tutorial
  2. What is Hibernate in Java?
  3. Hibernate Overview
  4. Hibernate Example Step by Step in Eclipse
  5. Hibernate 4 Tutorial
  6. Complete Hibernate 4.0 Tutorial


Benefits of using annotation:

  • Only one Java file to work
  • Easily define mapping in Java pojo file
  • Less changes of error
  • Very easy
  • Work fast


Check large collection Hibernate tutorials at roseindia.net.


Thanks



No comments: