KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > hql > Animal


1 //$Id: Animal.java,v 1.5 2005/07/10 16:51:17 oneovthafew Exp $
2
package org.hibernate.test.hql;
3
4 import java.util.Set JavaDoc;
5 import java.util.HashSet JavaDoc;
6
7 /**
8  * @author Gavin King
9  */

10 public class Animal {
11     private Long JavaDoc id;
12     private float bodyWeight;
13     private Set JavaDoc offspring;
14     private Animal mother;
15     private Animal father;
16     private String JavaDoc description;
17     private Zoo zoo;
18     private String JavaDoc serialNumber;
19
20     public Animal() {
21     }
22
23     public Animal(String JavaDoc description, float bodyWeight) {
24         this.description = description;
25         this.bodyWeight = bodyWeight;
26     }
27
28     public Long JavaDoc getId() {
29         return id;
30     }
31
32     public void setId(Long JavaDoc id) {
33         this.id = id;
34     }
35
36     public float getBodyWeight() {
37         return bodyWeight;
38     }
39
40     public void setBodyWeight(float bodyWeight) {
41         this.bodyWeight = bodyWeight;
42     }
43
44     public Set JavaDoc getOffspring() {
45         return offspring;
46     }
47
48     public void addOffspring(Animal offspring) {
49         if ( this.offspring == null ) {
50             this.offspring = new HashSet JavaDoc();
51         }
52
53         this.offspring.add( offspring );
54     }
55
56     public void setOffspring(Set JavaDoc offspring) {
57         this.offspring = offspring;
58     }
59
60     public Animal getMother() {
61         return mother;
62     }
63
64     public void setMother(Animal mother) {
65         this.mother = mother;
66     }
67
68     public Animal getFather() {
69         return father;
70     }
71
72     public void setFather(Animal father) {
73         this.father = father;
74     }
75
76     public String JavaDoc getDescription() {
77         return description;
78     }
79
80     public void setDescription(String JavaDoc description) {
81         this.description = description;
82     }
83
84     public Zoo getZoo() {
85         return zoo;
86     }
87
88     public void setZoo(Zoo zoo) {
89         this.zoo = zoo;
90     }
91
92     public String JavaDoc getSerialNumber() {
93         return serialNumber;
94     }
95
96     public void setSerialNumber(String JavaDoc serialNumber) {
97         this.serialNumber = serialNumber;
98     }
99 }
100
Popular Tags