Annotation | Purpose |
---|---|
@TableGenerator | Specifies generator name and table name where generator can be found |
@GeneratedValue | Specifies generation strategy and refers to name of generator |
@ManyToOne | Specifies 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 |