1 package org.hibernate.test.hql; 3 4 import java.util.Set ; 5 import java.util.HashSet ; 6 7 10 public class Animal { 11 private Long id; 12 private float bodyWeight; 13 private Set offspring; 14 private Animal mother; 15 private Animal father; 16 private String description; 17 private Zoo zoo; 18 private String serialNumber; 19 20 public Animal() { 21 } 22 23 public Animal(String description, float bodyWeight) { 24 this.description = description; 25 this.bodyWeight = bodyWeight; 26 } 27 28 public Long getId() { 29 return id; 30 } 31 32 public void setId(Long 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 getOffspring() { 45 return offspring; 46 } 47 48 public void addOffspring(Animal offspring) { 49 if ( this.offspring == null ) { 50 this.offspring = new HashSet (); 51 } 52 53 this.offspring.add( offspring ); 54 } 55 56 public void setOffspring(Set 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 getDescription() { 77 return description; 78 } 79 80 public void setDescription(String 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 getSerialNumber() { 93 return serialNumber; 94 } 95 96 public void setSerialNumber(String serialNumber) { 97 this.serialNumber = serialNumber; 98 } 99 } 100 | Popular Tags |