1 22 package org.jboss.ejb3.test.secondary; 23 24 import javax.persistence.Column; 25 import javax.persistence.Entity; 26 import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; 27 import javax.persistence.Id; 28 import javax.persistence.JoinColumn; 29 import javax.persistence.SecondaryTable; 30 31 36 @Entity 37 @SecondaryTable(name = "EMBEDDED_ADDRESS") 38 public class Customer implements java.io.Serializable 39 { 40 Long id; 41 String name; 42 String street; 43 String city; 44 String state; 45 String zip; 46 47 public 48 Customer() 49 { 50 } 51 52 @Id @GeneratedValue(strategy=GenerationType.IDENTITY) 53 public 54 Long getId() 55 { 56 return id; 57 } 58 59 public 60 String getName() 61 { 62 return name; 63 } 64 65 public 66 void setId(Long long1) 67 { 68 id = long1; 69 } 70 71 public 72 void setName(String string) 73 { 74 name = string; 75 } 76 77 @Column(name = "street", table = "EMBEDDED_ADDRESS") 78 public String getStreet() 79 { 80 return street; 81 } 82 83 public void setStreet(String street) 84 { 85 this.street = street; 86 } 87 88 @Column(name = "city", table = "EMBEDDED_ADDRESS") 89 public String getCity() 90 { 91 return city; 92 } 93 94 public void setCity(String city) 95 { 96 this.city = city; 97 } 98 99 @Column(name = "state", table = "EMBEDDED_ADDRESS") 100 public String getState() 101 { 102 return state; 103 } 104 105 public void setState(String state) 106 { 107 this.state = state; 108 } 109 110 @Column(name = "zip", table = "EMBEDDED_ADDRESS") 111 public String getZip() 112 { 113 return zip; 114 } 115 116 public void setZip(String zip) 117 { 118 this.zip = zip; 119 } 120 121 } 122 123 | Popular Tags |