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