1 package myorg.entityex.annotated;
2
3 import java.io.Serializable;
4
5 import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id;
8 import javax.persistence.Lob;
9 import javax.persistence.Table;
10
11 @Entity
12 @Table(name="ENTITYEX_HORSE")
13 public class Horse {
14 public static class Jockey implements Serializable {
15 private static final long serialVersionUID = 1L;
16 private String name;
17 public String getName() { return name; }
18 public void setName(String name) { this.name = name; }
19 }
20 @Id @GeneratedValue
21 private int id;
22 private String name;
23 @Lob
24 private String description;
25 @Lob
26 private char[] history;
27 @Lob
28 private byte[] photo;
29 @Lob
30 private Jockey jockey;
31
32 public int getId() { return id; }
33 public void setId(int id) {
34 this.id = id;
35 }
36
37 public String getName() { return name; }
38 public void setName(String name) {
39 this.name = name;
40 }
41
42 public String getDescription() { return description; }
43 public void setDescription(String description) {
44 this.description = description;
45 }
46
47 public char[] getHistory() { return history; }
48 public void setHistory(char[] history) {
49 this.history = history;
50 }
51
52 public byte[] getPhoto() { return photo; }
53 public void setPhoto(byte[] photo) {
54 this.photo = photo;
55 }
56
57 public Jockey getJockey() { return jockey; }
58 public void setJockey(Jockey jockey) {
59 this.jockey = jockey;
60 }
61 }