Skip to content

Instantly share code, notes, and snippets.

@Hafiz-SE

Hafiz-SE/Department.java

Last active Jun 14, 2020
Embed
What would you like to do?
@Entity
@Table(name = AppTables.department)
public class Department {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = AppTables.departmentTable.id)
private Long id;
@Column(name = AppTables.departmentTable.name)
private String name;
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = AppTables.departmentTable.departmentHead)
private Employee departmentHead;
// Getters and setters are omitted for brevity
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.