KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > legacy > Contained


1 //$Id: Contained.java,v 1.1 2004/09/26 05:18:25 oneovthafew Exp $
2
package org.hibernate.test.legacy;
3
4 import java.util.ArrayList JavaDoc;
5 import java.util.Collection JavaDoc;
6
7 public class Contained {
8     private Container container;
9     private long id;
10     private Collection JavaDoc bag = new ArrayList JavaDoc();
11     private Collection JavaDoc lazyBag = new ArrayList JavaDoc();
12     
13     public boolean equals(Object JavaDoc other) {
14         return id==( (Contained) other ).getId();
15     }
16     public int hashCode() {
17         return new Long JavaDoc(id).hashCode();
18     }
19     
20     /**
21      * Returns the container.
22      * @return Container
23      */

24     public Container getContainer() {
25         return container;
26     }
27     
28     /**
29      * Returns the id.
30      * @return long
31      */

32     public long getId() {
33         return id;
34     }
35     
36     /**
37      * Sets the container.
38      * @param container The container to set
39      */

40     public void setContainer(Container container) {
41         this.container = container;
42     }
43     
44     /**
45      * Sets the id.
46      * @param id The id to set
47      */

48     public void setId(long id) {
49         this.id = id;
50     }
51     
52     /**
53      * Returns the bag.
54      * @return Collection
55      */

56     public Collection JavaDoc getBag() {
57         return bag;
58     }
59     
60     /**
61      * Sets the bag.
62      * @param bag The bag to set
63      */

64     public void setBag(Collection JavaDoc bag) {
65         this.bag = bag;
66     }
67     
68     /**
69      * Returns the lazyBag.
70      * @return Collection
71      */

72     public Collection JavaDoc getLazyBag() {
73         return lazyBag;
74     }
75     
76     /**
77      * Sets the lazyBag.
78      * @param lazyBag The lazyBag to set
79      */

80     public void setLazyBag(Collection JavaDoc lazyBag) {
81         this.lazyBag = lazyBag;
82     }
83     
84 }
85
86
87
88
89
90
91
Popular Tags