KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: Folder.java,v 1.3 2005/07/20 00:18:06 epbernard Exp $
2
package org.hibernate.test.annotations.inheritance.union;
3
4 import java.util.HashSet JavaDoc;
5 import java.util.Set JavaDoc;
6
7 import javax.persistence.Entity;
8 import javax.persistence.OneToMany;
9 import javax.persistence.Table;
10
11 /**
12  * @author Emmanuel Bernard
13  */

14 @Entity
15 @Table(name="FolderUnion")
16 public class Folder extends File {
17     private Set JavaDoc<File> children = new HashSet JavaDoc<File>();
18     
19     Folder() {}
20     public Folder(String JavaDoc name) {
21         super(name);
22     }
23     
24     @OneToMany(mappedBy="parent")
25     public Set JavaDoc<File> getChildren() {
26         return children;
27     }
28     public void setChildren(Set JavaDoc children) {
29         this.children = children;
30     }
31 }
32
Popular Tags