KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > annotations > inheritance > union > File


1 //$Id: File.java,v 1.1 2005/06/12 19:29:32 oneovthafew Exp $
2
package org.hibernate.test.annotations.inheritance.union;
3
4 import javax.persistence.Entity;
5 import javax.persistence.Id;
6 import javax.persistence.Inheritance;
7 import javax.persistence.InheritanceType;
8 import javax.persistence.ManyToOne;
9
10 /**
11  * @author Emmanuel Bernard
12  */

13 @Entity
14 @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
15 public abstract class File {
16     private String JavaDoc name;
17     private Folder parent;
18     
19     File() {}
20     public File(String JavaDoc name) {
21         this.name = name;
22     }
23
24     @Id
25     public String JavaDoc getName() {
26         return name;
27     }
28
29     public void setName(String JavaDoc id) {
30         this.name = id;
31     }
32     
33     @ManyToOne
34     public Folder getParent() {
35         return parent;
36     }
37     public void setParent(Folder parent) {
38         this.parent = parent;
39     }
40
41 }
42
Popular Tags