1 package ejava.examples.orm.core.annotated;
2
3 import javax.persistence.*;
4
5
6
7
8
9
10
11
12
13 @Entity
14 @Table(name="ORMCORE_XRAY")
15 public class XRay {
16 @Id
17 private long id;
18 @Embedded
19 @AttributeOverrides({
20 @AttributeOverride(name="name", column=@Column(name="XRAY_MAKER"))
21
22 })
23 private Manufacturer maker;
24 private String model;
25
26 public XRay() {}
27 public XRay(long id) { this.id = id; }
28
29 public long getId() { return id; }
30
31 public String getModel() { return model; }
32 public void setModel(String model) {
33 this.model = model;
34 }
35
36 public Manufacturer getMaker() { return maker; }
37 public void setMaker(Manufacturer maker) {
38 this.maker = maker;
39 }
40
41 public String toString() {
42 return new StringBuilder()
43 .append(super.getClass().getName())
44 .append(", id=").append(id)
45 .append(", model=").append(model)
46 .append(", maker=").append(maker)
47 .toString();
48 }
49 }