1 22 package org.jboss.ejb3.test.regression.salesforce7123; 23 24 import java.util.ArrayList ; 25 import java.util.List ; 26 import java.io.Serializable ; 27 import static javax.persistence.CascadeType.ALL; 28 import javax.persistence.Entity; 29 import javax.persistence.GeneratedValue; 30 import javax.persistence.Id; 31 import javax.persistence.OneToMany; 32 33 39 @Entity 40 public class BaseData implements Serializable 41 { 42 private int id; 43 private String name; 44 private List <Child> children = new ArrayList <Child>(); 45 46 @Id @GeneratedValue 47 public int getId() 48 { 49 return id; 50 } 51 52 public void setId(int id) 53 { 54 this.id = id; 55 } 56 57 public String getName() 58 { 59 return name; 60 } 61 62 public void setName(String name) 63 { 64 this.name = name; 65 } 66 67 @OneToMany(mappedBy="parent", cascade=ALL) 68 public List <Child> getChildren() 69 { 70 return children; 71 } 72 73 public void setChildren(List <Child> children) 74 { 75 this.children = children; 76 } 77 78 public void prepareTransport() 79 { 80 this.children = new ArrayList <Child>(); 81 } 82 83 84 } 85 | Popular Tags |