1 9 10 package org.demo; 11 12 import java.io.Serializable ; 13 import javax.persistence.CascadeType; 14 import javax.persistence.Column; 15 import javax.persistence.Entity; 16 import javax.persistence.Id; 17 import javax.persistence.NamedQueries; 18 import javax.persistence.NamedQuery; 19 import javax.persistence.OneToMany; 20 import javax.persistence.Table; 21 22 26 @Entity 27 @Table(name = "MANUFACTURE") 28 @NamedQueries( {@NamedQuery(name = "Manufacture.findByManufactureId", query = "SELECT m FROM Manufacture m WHERE m.manufactureId = :manufactureId"), @NamedQuery(name = "Manufacture.findByName", query = "SELECT m FROM Manufacture m WHERE m.name = :name"), @NamedQuery(name = "Manufacture.findByAddressline1", query = "SELECT m FROM Manufacture m WHERE m.addressline1 = :addressline1"), @NamedQuery(name = "Manufacture.findByAddressline2", query = "SELECT m FROM Manufacture m WHERE m.addressline2 = :addressline2"), @NamedQuery(name = "Manufacture.findByCity", query = "SELECT m FROM Manufacture m WHERE m.city = :city"), @NamedQuery(name = "Manufacture.findByState", query = "SELECT m FROM Manufacture m WHERE m.state = :state"), @NamedQuery(name = "Manufacture.findByZip", query = "SELECT m FROM Manufacture m WHERE m.zip = :zip"), @NamedQuery(name = "Manufacture.findByPhone", query = "SELECT m FROM Manufacture m WHERE m.phone = :phone"), @NamedQuery(name = "Manufacture.findByFax", query = "SELECT m FROM Manufacture m WHERE m.fax = :fax"), @NamedQuery(name = "Manufacture.findByEmail", query = "SELECT m FROM Manufacture m WHERE m.email = :email"), @NamedQuery(name = "Manufacture.findByRep", query = "SELECT m FROM Manufacture m WHERE m.rep = :rep")}) 29 public class Manufacture implements Serializable { 30 31 @Id 32 @Column(name = "MANUFACTURE_ID", nullable = false) 33 private Integer manufactureId; 34 35 @Column(name = "NAME") 36 private String name; 37 38 @Column(name = "ADDRESSLINE1") 39 private String addressline1; 40 41 @Column(name = "ADDRESSLINE2") 42 private String addressline2; 43 44 @Column(name = "CITY") 45 private String city; 46 47 @Column(name = "STATE") 48 private String state; 49 50 @Column(name = "ZIP") 51 private String zip; 52 53 @Column(name = "PHONE") 54 private String phone; 55 56 @Column(name = "FAX") 57 private String fax; 58 59 @Column(name = "EMAIL") 60 private String email; 61 62 @Column(name = "REP") 63 private String rep; 64 65 @OneToMany(cascade = CascadeType.ALL, mappedBy = "manufactureId") 66 private java.util.Collection <org.demo.Product> product; 67 68 69 public Manufacture() { 70 } 71 72 public Manufacture(Integer manufactureId) { 73 this.manufactureId = manufactureId; 74 } 75 76 public Integer getManufactureId() { 77 return this.manufactureId; 78 } 79 80 public void setManufactureId(Integer manufactureId) { 81 this.manufactureId = manufactureId; 82 } 83 84 public String getName() { 85 return this.name; 86 } 87 88 public void setName(String name) { 89 this.name = name; 90 } 91 92 public String getAddressline1() { 93 return this.addressline1; 94 } 95 96 public void setAddressline1(String addressline1) { 97 this.addressline1 = addressline1; 98 } 99 100 public String getAddressline2() { 101 return this.addressline2; 102 } 103 104 public void setAddressline2(String addressline2) { 105 this.addressline2 = addressline2; 106 } 107 108 public String getCity() { 109 return this.city; 110 } 111 112 public void setCity(String city) { 113 this.city = city; 114 } 115 116 public String getState() { 117 return this.state; 118 } 119 120 public void setState(String state) { 121 this.state = state; 122 } 123 124 public String getZip() { 125 return this.zip; 126 } 127 128 public void setZip(String zip) { 129 this.zip = zip; 130 } 131 132 public String getPhone() { 133 return this.phone; 134 } 135 136 public void setPhone(String phone) { 137 this.phone = phone; 138 } 139 140 public String getFax() { 141 return this.fax; 142 } 143 144 public void setFax(String fax) { 145 this.fax = fax; 146 } 147 148 public String getEmail() { 149 return this.email; 150 } 151 152 public void setEmail(String email) { 153 this.email = email; 154 } 155 156 public String getRep() { 157 return this.rep; 158 } 159 160 public void setRep(String rep) { 161 this.rep = rep; 162 } 163 164 public java.util.Collection <org.demo.Product> getProduct() { 165 return this.product; 166 } 167 168 public void setProduct(java.util.Collection <org.demo.Product> product) { 169 this.product = product; 170 } 171 172 public int hashCode() { 173 int hash = 0; 174 hash += (this.manufactureId != null ? this.manufactureId.hashCode() : 0); 175 return hash; 176 } 177 178 public boolean equals(Object object) { 179 if (!(object instanceof Manufacture)) { 180 return false; 181 } 182 Manufacture other = (Manufacture)object; 183 if (this.manufactureId != other.manufactureId && (this.manufactureId == null || !this.manufactureId.equals(other.manufactureId))) return false; 184 return true; 185 } 186 187 public String toString() { 188 return "" + this.manufactureId; 190 } 191 192 } 193 | Popular Tags |