1 package de.test.schemaexport.domain;
\r
3 import javax.persistence.CascadeType;
\r
4 import javax.persistence.Column;
\r
5 import javax.persistence.Entity;
\r
6 import javax.persistence.FetchType;
\r
7 import javax.persistence.GeneratedValue;
\r
8 import javax.persistence.GenerationType;
\r
9 import javax.persistence.Id;
\r
10 import javax.persistence.JoinColumn;
\r
11 import javax.persistence.ManyToOne;
\r
12 import javax.persistence.Table;
\r
16 import org.hibernate.validator.constraints.Length;
\r
19 @Table(name = "Employee")
\r
20 public class Employee {
\r
23 @Column(name = "OID")
\r
24 @GeneratedValue(strategy = GenerationType.AUTO)
\r
27 @Length(min = 4, max = 81)
\r
28 @Column(name = "name", nullable = false)
\r
29 private String name;
\r
31 @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
\r
32 @JoinColumn(name = "FK_department", nullable = true)
\r
33 private Department department;
\r
35 public long getOid() {
\r
39 public void setOid(long oid) {
\r
43 public String getName() {
\r
47 public void setName(String name) {
\r
51 public Department getDepartment() {
\r
55 public void setDepartment(Department department) {
\r
56 this.department = department;
\r