KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > hibernate > Pet


1 package test.hibernate;
2
3 /**
4  * @author Administrator
5  *
6  * @hibernate.subclass
7  * table="PETS"
8  * discriminator-value="pet"
9  */

10 public class Pet extends Product {
11
12     private Animal animal;
13
14     /**
15      * Constructor for Pet.
16      */

17     public Pet() {
18         super();
19     }
20
21     /**
22      * @hibernate.one-to-one
23      * @return Animal
24      */

25     public Animal getAnimal() {
26         return animal;
27     }
28
29     /**
30      * Sets the animal.
31      * @param animal The animal to set
32      */

33     public void setAnimal(Animal animal) {
34         this.animal = animal;
35     }
36
37 }
38
Popular Tags