View Javadoc
1   package ejava.examples.orm.inheritance.annotated;
2   
3   import javax.persistence.*;
4   
5   /**
6    * This class provides an example of an entity sub-class that is part of a 
7    * mixed strategy of inheritance. The root base class is a non-entity and 
8    * the immediate base class uses a join table strategy. That means that a table
9    * will be created to hold the unque properties of this class and joined with
10   * the parent table.
11   *
12   * @author jcstaff
13   */
14  @Entity @Table(name="ORMINH_CIRCLE")
15  public class Circle extends Shape {
16      private int radius;
17  
18      @Transient
19      public String getName() {
20          return "circle:" + getId();
21      }
22  
23      public int getRadius() {
24          return radius;
25      }
26      public void setRadius(int radius) {
27          this.radius = radius;
28      }
29  
30      public String toString() {
31          StringBuilder text = new StringBuilder(super.toString());
32          text.append(", radius=" + radius);
33          return text.toString();
34      }
35  }