KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > annotations > entity > Address


1 //$Id: Address.java,v 1.2 2005/07/26 04:57:09 epbernard Exp $
2
package org.hibernate.test.annotations.entity;
3
4 import javax.persistence.Entity;
5 import javax.persistence.GeneratorType;
6 import javax.persistence.Id;
7 import javax.persistence.Table;
8
9 /**
10  * Has a serializable class as a property
11  *
12  * @author Emmanuel Bernard
13  */

14 @Entity
15 @Table(name="serial_address")
16 public class Address {
17     private Integer JavaDoc id;
18     private String JavaDoc city;
19
20     @Id(generate=GeneratorType.AUTO)
21     public Integer JavaDoc getId() {
22         return id;
23     }
24
25     public void setId(Integer JavaDoc id) {
26         this.id = id;
27     }
28
29     public String JavaDoc getCity() {
30         return city;
31     }
32
33     public void setCity(String JavaDoc city) {
34         this.city = city;
35     }
36
37     public Country getCountry() {
38         return country;
39     }
40
41     public void setCountry(Country country) {
42         this.country = country;
43     }
44
45     private Country country;
46 }
47
Popular Tags