View Javadoc
1   package ejava.examples.orm.map.annotated;
2   
3   import javax.persistence.*;
4   
5   /**
6    * This class represents a child in a One-to-Many, uni-directional
7    * relationship, relative to the parent. This class makes no reference
8    * to the relationship. It is only known to the parent.
9    */
10  @Entity @Table(name="ORMMAP_ONEMANY_CHILD")
11  public class OneManyChild {
12      @Id @Column(name="ID")
13      private String name;
14      
15      protected OneManyChild() {}
16      public OneManyChild(String name) { this.name = name; }
17  
18      public String getName() { return name; }
19      public void setName(String name) {
20              this.name = name;
21      }
22      
23      public String toString() {
24              StringBuilder text = new StringBuilder();
25              text.append(getClass().getName());
26              text.append(", name=" + name);
27              return text.toString();
28      }
29  }