KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: File.java,v 1.2 2005/06/16 19:41:16 epbernard Exp $
2
package org.hibernate.test.annotations.inheritance.joined;
3
4 import javax.persistence.AccessType;
5 import javax.persistence.Entity;
6 import javax.persistence.Id;
7 import javax.persistence.Inheritance;
8 import javax.persistence.InheritanceType;
9 import javax.persistence.ManyToOne;
10
11 /**
12  * @author Emmanuel Bernard
13  */

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