KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > hibernate > Animal


1 package test.hibernate;
2
3 import java.util.Set JavaDoc;
4
5 /**
6  * @author Administrator
7  *
8  * @hibernate.class
9  * table="ANIMALS"
10  * dynamic-update="true"
11  *
12  * @hibernate.discriminator column="disc"
13  * not-null="true"
14  * force="false"
15  */

16 public class Animal extends Persistent {
17     
18     private Set JavaDoc prey;
19     private char sex;
20
21     /**
22      * Constructor for Animal.
23      */

24     public Animal() {
25         super();
26     }
27
28     /**
29      * @hibernate.set
30      * lazy="true"
31      * table="PREDATOR_PREY"
32      * order-by="PREY_ID"
33      * @hibernate.collection-key
34      * column="PREDATOR_ID"
35      * @hibernate.collection-many-to-many
36      * column="PREY_ID"
37      * @return Set
38      */

39     public Set JavaDoc getPrey() {
40         return prey;
41     }
42
43     /**
44      * Sets the prey.
45      * @param prey The prey to set
46      */

47     public void setPrey(Set JavaDoc prey) {
48         this.prey = prey;
49     }
50
51     /**
52      * @hibernate.property
53      * not-null="true"
54      * Returns the sex.
55      * @return char
56      */

57     public char getSex() {
58         return sex;
59     }
60
61     /**
62      * Sets the sex.
63      * @param sex The sex to set
64      */

65     public void setSex(char sex) {
66         this.sex = sex;
67     }
68
69 }
70
Popular Tags