WIP:site
[hibernate4-maven-plugin] / schemaexport / domain / Employee.java
1 package de.test.schemaexport.domain;\r
2 \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
13 \r
14 \r
15 \r
16 import org.hibernate.validator.constraints.Length;\r
17 \r
18 @Entity\r
19 @Table(name = "Employee")\r
20 public class Employee {\r
21 \r
22         @Id\r
23         @Column(name = "OID")\r
24         @GeneratedValue(strategy = GenerationType.AUTO)\r
25         private long oid;\r
26         \r
27         @Length(min = 4, max = 81)\r
28         @Column(name = "name", nullable = false)\r
29         private String name;\r
30         \r
31         @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)\r
32         @JoinColumn(name = "FK_department", nullable = true)\r
33         private Department department;\r
34 \r
35         public long getOid() {\r
36                 return oid;\r
37         }\r
38 \r
39         public void setOid(long oid) {\r
40                 this.oid = oid;\r
41         }\r
42 \r
43         public String getName() {\r
44                 return name;\r
45         }\r
46 \r
47         public void setName(String name) {\r
48                 this.name = name;\r
49         }\r
50 \r
51         public Department getDepartment() {\r
52                 return department;\r
53         }\r
54 \r
55         public void setDepartment(Department department) {\r
56                 this.department = department;\r
57         }\r
58         \r
59         \r
60 }\r