1 package myorg.entityex.annotated;
2
3 import java.util.Date;
4
5 @javax.persistence.Entity
6 public class Animal2 {
7 @javax.persistence.Id
8 private int id;
9 private String name;
10 private Date dob;
11 private double weight;
12
13 public Animal2() {}
14 public Animal2(String name, Date dob, double weight) {
15 this.name = name;
16 this.dob = dob;
17 this.weight = weight;
18 }
19
20 public int getId() { return id; }
21 public void setId(int id) {
22 this.id = id;
23 }
24
25 public String getName() { return name; }
26 public void setName(String name) {
27 this.name = name;
28 }
29
30 public Date getDob() { return dob; }
31 public void setDob(Date dob) {
32 this.dob = dob;
33 }
34
35 public double getWeight() { return weight; }
36 public void setWeight(double weight) {
37 this.weight = weight;
38 }
39 }