Monday, November 22, 2010

Reinforcing development using Java Annotations

Java Annotation which is introduced to Java in in Java 1.5 has made the development simple which less lines of code. A few days back I was exploring the Hibernate an ORM (Object Relational Mapping) framework. When I run my first example on Hibernate, I wrote xml files for the mapping of beans to the tables in MySql database. There were mapping xml file, beans, configuration file. The on further exploration I come to know JPA 2.0(Java Persistence API) can also be used for persistence with Hibernate. There in JPA I encountered with the power of annotations in Java. It made the persistence not only simple but reduced the number of file in the project. With the use of annotations the mapping was done and then there was not any need of the mapping xml file. I found it very simple and handy in handling persistence. Now I am looking towards EJB 3.0 where also the power of annotation can be seen which was not there in EJB 2.

No comments: