/[projects]/miscJava/HiberTest1/src/dk/thoerup/hibertest1/Department.java
ViewVC logotype

Annotation of /miscJava/HiberTest1/src/dk/thoerup/hibertest1/Department.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 620 - (hide annotations) (download)
Mon Mar 1 15:33:45 2010 UTC (14 years, 3 months ago) by torben
File size: 924 byte(s)
Code sync
1 torben 599 package dk.thoerup.hibertest1;
2    
3     import java.io.Serializable;
4 torben 620 import java.util.List;
5 torben 599
6     import javax.persistence.Column;
7     import javax.persistence.Entity;
8     import javax.persistence.Id;
9 torben 620 import javax.persistence.JoinColumn;
10     import javax.persistence.OneToMany;
11 torben 599 import javax.persistence.Table;
12    
13    
14     @Entity
15     @Table(name = "department")
16     public class Department implements Serializable {
17    
18     private static final long serialVersionUID = 1L;
19    
20    
21    
22     public Department() {
23    
24     }
25     @Id
26     @Column(name = "id")
27     Integer id;
28    
29     @Column(name = "name")
30     String name;
31 torben 620
32     @OneToMany
33     @JoinColumn( name="dept")
34     List<Employee> emplyees;
35 torben 599
36    
37 torben 620 public List<Employee> getEmplyeees() {
38     return emplyees;
39     }
40 torben 599
41     public Integer getId() {
42     return id;
43     }
44    
45     public void setId(Integer id) {
46     this.id = id;
47     }
48    
49     public String getName() {
50     return name;
51     }
52    
53     public void setName(String name) {
54     this.name = name;
55     }
56    
57     }

  ViewVC Help
Powered by ViewVC 1.1.20