1 package myorg.entityex.mapped;
2
3 import java.util.Date;
4
5
6 public class Animal {
7 private int id;
8 private String name;
9 private Date dob;
10 private double weight;
11
12 public Animal() {}
13 public Animal(String name, Date dob, double weight) {
14 this.name = name;
15 this.dob = dob;
16 this.weight = weight;
17 }
18
19 public int getId() { return id; }
20 public void setId(int id) {
21 this.id = id;
22 }
23
24 public String getName() { return name; }
25 public void setName(String name) {
26 this.name = name;
27 }
28
29 public Date getDob() { return dob; }
30 public void setDob(Date dob) {
31 this.dob = dob;
32 }
33
34 public double getWeight() { return weight; }
35 public void setWeight(double weight) {
36 this.weight = weight;
37 }
38
39 @Override
40 public String toString() {
41 StringBuilder builder = new StringBuilder();
42 builder.append("Animal [id=").append(id)
43 .append(", name=").append(name)
44 .append(", dob=").append(dob)
45 .append(", weight=").append(weight)
46 .append("]");
47 return builder.toString();
48 }
49
50
51 }