jpaOne to Many relationship


Parameters

AnnotationPurpose
@TableGeneratorSpecifies generator name and table name where generator can be found
@GeneratedValueSpecifies generation strategy and refers to name of generator
@ManyToOneSpecifies many to one relationship between Employee and Department
@OneToMany(mappedBy="department")creates bi-directional relationship between Employee and Department by simply referring to @ManyToOne annotation in Employee entity