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