View Javadoc
1   package ejava.examples.orm.map.annotated;
2   
3   import javax.persistence.*;
4   
5   /**
6    * This class represents a stand-alone object in a Many-to-Many, 
7    * uni-directional relationship. This entity makes no 
8    * reference to the other entities. ManyManyOwningEntity defines the 
9    * relationship.
10   */
11  @Entity @Table(name="ORMMAP_MANYMANY_ENTITY")
12  public class ManyManyEntity {
13      @Id
14      private String name;
15  
16      protected ManyManyEntity() {}
17      public ManyManyEntity(String name) {
18              this.name = name;
19      }
20  
21      public String getName() { return name; }
22      public void setName(String name) {
23              this.name = name;
24      }
25      
26      public String toString() {
27              StringBuilder text = new StringBuilder();
28              text.append(getClass().getName());
29              text.append(", name=" + name);
30              return text.toString();
31      }
32  }