1 package org.hibernate.test.unionsubclass; 3 4 import java.util.ArrayList ; 5 import java.util.Collection ; 6 7 10 public class Location { 11 private long id; 12 private String name; 13 private Collection beings = new ArrayList (); 14 15 Location() {} 16 17 public Location(String name) { 18 this.name = name; 19 } 20 21 public void addBeing(Being b) { 22 b.setLocation(this); 23 beings.add(b); 24 } 25 28 public long getId() { 29 return id; 30 } 31 34 public void setId(long id) { 35 this.id = id; 36 } 37 40 public String getName() { 41 return name; 42 } 43 46 public void setName(String name) { 47 this.name = name; 48 } 49 52 public Collection getBeings() { 53 return beings; 54 } 55 58 public void setBeings(Collection beings) { 59 this.beings = beings; 60 } 61 } 62 | Popular Tags |