KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > demo > Manufacture


1 /*
2  * Manufacture.java
3  *
4  * Created on May 25, 2006, 11:31 AM
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package org.demo;
11
12 import java.io.Serializable JavaDoc;
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 /**
23  *
24  * @author ak199487
25  */

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 JavaDoc {
30
31     @Id
32     @Column(name = "MANUFACTURE_ID", nullable = false)
33     private Integer JavaDoc manufactureId;
34
35     @Column(name = "NAME")
36     private String JavaDoc name;
37
38     @Column(name = "ADDRESSLINE1")
39     private String JavaDoc addressline1;
40
41     @Column(name = "ADDRESSLINE2")
42     private String JavaDoc addressline2;
43
44     @Column(name = "CITY")
45     private String JavaDoc city;
46
47     @Column(name = "STATE")
48     private String JavaDoc state;
49
50     @Column(name = "ZIP")
51     private String JavaDoc zip;
52
53     @Column(name = "PHONE")
54     private String JavaDoc phone;
55
56     @Column(name = "FAX")
57     private String JavaDoc fax;
58
59     @Column(name = "EMAIL")
60     private String JavaDoc email;
61
62     @Column(name = "REP")
63     private String JavaDoc rep;
64
65     @OneToMany(cascade = CascadeType.ALL, mappedBy = "manufactureId")
66     private java.util.Collection JavaDoc <org.demo.Product> product;
67     
68     /** Creates a new instance of Manufacture */
69     public Manufacture() {
70     }
71
72     public Manufacture(Integer JavaDoc manufactureId) {
73         this.manufactureId = manufactureId;
74     }
75
76     public Integer JavaDoc getManufactureId() {
77         return this.manufactureId;
78     }
79
80     public void setManufactureId(Integer JavaDoc manufactureId) {
81         this.manufactureId = manufactureId;
82     }
83
84     public String JavaDoc getName() {
85         return this.name;
86     }
87
88     public void setName(String JavaDoc name) {
89         this.name = name;
90     }
91
92     public String JavaDoc getAddressline1() {
93         return this.addressline1;
94     }
95
96     public void setAddressline1(String JavaDoc addressline1) {
97         this.addressline1 = addressline1;
98     }
99
100     public String JavaDoc getAddressline2() {
101         return this.addressline2;
102     }
103
104     public void setAddressline2(String JavaDoc addressline2) {
105         this.addressline2 = addressline2;
106     }
107
108     public String JavaDoc getCity() {
109         return this.city;
110     }
111
112     public void setCity(String JavaDoc city) {
113         this.city = city;
114     }
115
116     public String JavaDoc getState() {
117         return this.state;
118     }
119
120     public void setState(String JavaDoc state) {
121         this.state = state;
122     }
123
124     public String JavaDoc getZip() {
125         return this.zip;
126     }
127
128     public void setZip(String JavaDoc zip) {
129         this.zip = zip;
130     }
131
132     public String JavaDoc getPhone() {
133         return this.phone;
134     }
135
136     public void setPhone(String JavaDoc phone) {
137         this.phone = phone;
138     }
139
140     public String JavaDoc getFax() {
141         return this.fax;
142     }
143
144     public void setFax(String JavaDoc fax) {
145         this.fax = fax;
146     }
147
148     public String JavaDoc getEmail() {
149         return this.email;
150     }
151
152     public void setEmail(String JavaDoc email) {
153         this.email = email;
154     }
155
156     public String JavaDoc getRep() {
157         return this.rep;
158     }
159
160     public void setRep(String JavaDoc rep) {
161         this.rep = rep;
162     }
163
164     public java.util.Collection JavaDoc <org.demo.Product> getProduct() {
165         return this.product;
166     }
167
168     public void setProduct(java.util.Collection JavaDoc <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 JavaDoc 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 JavaDoc toString() {
188         //TODO change toString() implementation to return a better display name
189
return "" + this.manufactureId;
190     }
191     
192 }
193
Popular Tags