KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > unionsubclass > Location


1 //$Id: Location.java,v 1.1 2004/08/17 09:20:17 oneovthafew Exp $
2
package org.hibernate.test.unionsubclass;
3
4 import java.util.ArrayList JavaDoc;
5 import java.util.Collection JavaDoc;
6
7 /**
8  * @author Gavin King
9  */

10 public class Location {
11     private long id;
12     private String JavaDoc name;
13     private Collection JavaDoc beings = new ArrayList JavaDoc();
14     
15     Location() {}
16     
17     public Location(String JavaDoc name) {
18         this.name = name;
19     }
20     
21     public void addBeing(Being b) {
22         b.setLocation(this);
23         beings.add(b);
24     }
25     /**
26      * @return Returns the id.
27      */

28     public long getId() {
29         return id;
30     }
31     /**
32      * @param id The id to set.
33      */

34     public void setId(long id) {
35         this.id = id;
36     }
37     /**
38      * @return Returns the name.
39      */

40     public String JavaDoc getName() {
41         return name;
42     }
43     /**
44      * @param name The name to set.
45      */

46     public void setName(String JavaDoc name) {
47         this.name = name;
48     }
49     /**
50      * @return Returns the beings.
51      */

52     public Collection JavaDoc getBeings() {
53         return beings;
54     }
55     /**
56      * @param beings The beings to set.
57      */

58     public void setBeings(Collection JavaDoc beings) {
59         this.beings = beings;
60     }
61 }
62
Popular Tags