1 package ejava.examples.orm.inheritance.annotated;
2
3 import javax.persistence.*;
4
5
6
7
8
9
10
11 @Entity
12 @Table(name="ORMINH_CUSTOMER")
13 public class Customer extends Person {
14 public enum Rating { GOLD, SILVER, BRONZE }
15 @Enumerated(EnumType.STRING)
16 private Rating rating;
17
18 public Customer() {}
19 public Customer(long id) { super(id); }
20
21 public Rating getRating() { return rating; }
22 public void setRating(Rating rating) {
23 this.rating = rating;
24 }
25
26 public String toString() {
27 StringBuilder text = new StringBuilder(super.toString());
28 text.append(", rating=" + rating);
29 return text.toString();
30 }
31 }