1 package org.hibernate.test.annotations.inheritance.union; 3 4 import java.util.HashSet ; 5 import java.util.Set ; 6 7 import javax.persistence.Entity; 8 import javax.persistence.OneToMany; 9 import javax.persistence.Table; 10 11 14 @Entity 15 @Table(name="FolderUnion") 16 public class Folder extends File { 17 private Set <File> children = new HashSet <File>(); 18 19 Folder() {} 20 public Folder(String name) { 21 super(name); 22 } 23 24 @OneToMany(mappedBy="parent") 25 public Set <File> getChildren() { 26 return children; 27 } 28 public void setChildren(Set children) { 29 this.children = children; 30 } 31 } 32 | Popular Tags |