1 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 14 @Entity 15 @Table(name="serial_address") 16 public class Address { 17 private Integer id; 18 private String city; 19 20 @Id(generate=GeneratorType.AUTO) 21 public Integer getId() { 22 return id; 23 } 24 25 public void setId(Integer id) { 26 this.id = id; 27 } 28 29 public String getCity() { 30 return city; 31 } 32 33 public void setCity(String 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 |