1 package ejava.examples.orm.inheritance.annotated;
2
3 import javax.persistence.*;
4
5
6
7
8
9
10
11
12 @Entity
13 @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
14 @Table(name="ORMINH_CUBE")
15 public class Cube extends Rectangle {
16 private int depth;
17
18 public int getDepth() {
19 return depth;
20 }
21 public void setDepth(int depth) {
22 this.depth = depth;
23 }
24
25 public String toString() {
26 StringBuilder text = new StringBuilder(super.toString());
27 text.append(", depth=" + depth);
28 return text.toString();
29 }
30
31 }