In this section we will see how we can develop Hibernate Annotations based example program. After completing this tutorial you will be able to use Hibernate Annotations in your project and develop Hibernate based applications quickly.
With the introduction of Java 5 annotations with the release of Java 5, the development of Hibernate applications becomes much easier. Now Hibernate provides the Annotations support and you can take the full advantage of Annotations in your project.
If you Hibernate Annotations while developing the persistence layer for your application, the development process will be much easier. You can easily include the Mapping metadata into your persistence class. So, don't have to use the separate xml file as metadata.
Here is the list of common Hibernate Annotations used in the applications.
Here an example of Entity class with Hibernate Annotations
@Entity @Table(name = "employee") public class Employee implements Serializable { public Employee() { } @Id @Column(name = "id") Integer id; @Column(name = "name") String name;
Read more at Quick Hibernate Annotation Tutorial and download the running code example.
Advertisements
Ads
Ads