Tag: hibernate annotations
Hibernate Annotations Introduction
Gun short point :- Annotations are replacement for XML Let us see few points regarding annotations in hibernate Annotations are introduced in java along with JDK 1.5, annotations are used to provide META data to the classes, variables, methods…
Jars Required For Hibernate Annotations
For working with annotations in hibernate, ensure our java version must be 1.5 or higher and we must use hibernate version 3.3 or higher, and in fact no need to use all the jar files to work with these…
Hibernate One To Many Annotation Example
Let us see an example on one to many annotations mapping… Files required.. Customers.java Vendor.java ForOurLogic.java hibernate.cfg.xml Customers.java package str; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = “Customers”) public class Customers{ @Id @Column(name = “custid”)…
Hibernate Many To One Annotation Example
Will find the example on hibernate many to one mapping using annotations Files required… Customers.java Vendor.java hibernate.cfg.xml ForOurLogic.java Customers.java package str; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name = “Customers”)…