1   package org.wcb.model.vo.hibernate;
2   
3   import java.io.Serializable;
4   import org.apache.commons.lang.builder.ToStringBuilder;
5   
6   import javax.persistence.*;
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  @Entity
31  @Table(name ="airport")
32  public class AirportBO implements Serializable {
33  
34      
35      private Integer id;
36  
37      
38      private String icao;
39  
40      
41      private String faa;
42  
43      
44      private String iata;
45  
46      
47      private String name;
48  
49      
50      private String municipal;
51  
52      
53      private String state;
54  
55      
56      private String country;
57  
58      
59      private String latitude;
60  
61      
62      private String longitude;
63  
64      
65      private String altitude;
66  
67      
68      public AirportBO(String icao, String faa, String iata, String name, String municipal, String state, String country, String latitude, String longitude, String altitude) {
69          this.icao = icao;
70          this.faa = faa;
71          this.iata = iata;
72          this.name = name;
73          this.municipal = municipal;
74          this.state = state;
75          this.country = country;
76          this.latitude = latitude;
77          this.longitude = longitude;
78          this.altitude = altitude;
79      }
80  
81      
82      public AirportBO() {
83      }
84  
85      
86      public AirportBO(String icao, String faa, String iata) {
87          this.icao = icao;
88          this.faa = faa;
89          this.iata = iata;
90      }
91  
92      
93  
94  
95  
96      @Id
97      @GeneratedValue(strategy= GenerationType.AUTO)
98      public Integer getId() {
99          return this.id;
100     }
101 
102     public void setId(Integer id) {
103         this.id = id;
104     }
105 
106     
107 
108 
109 
110     @Column(name = "icao", nullable=false, length=4)
111     public String getIcao() {
112         return this.icao;
113     }
114 
115     public void setIcao(String icao) {
116         this.icao = icao;
117     }
118 
119     
120 
121 
122 
123     @Column(name = "faa", nullable=false, length=4)
124     public String getFaa() {
125         return this.faa;
126     }
127 
128     public void setFaa(String faa) {
129         this.faa = faa;
130     }
131 
132     
133 
134 
135 
136     @Column(name = "iata", nullable=false, length=4)
137     public String getIata() {
138         return this.iata;
139     }
140 
141     public void setIata(String iata) {
142         this.iata = iata;
143     }
144 
145     
146 
147 
148 
149 
150     @Column(name = "name", length=50)
151     public String getName() {
152         return this.name;
153     }
154 
155     public void setName(String name) {
156         this.name = name;
157     }
158 
159     
160 
161 
162 
163     @Column(name = "municipal", length=50)
164     public String getMunicipal() {
165         return this.municipal;
166     }
167 
168     public void setMunicipal(String municipal) {
169         this.municipal = municipal;
170     }
171 
172     
173 
174 
175 
176     @Column(name = "state", length=50)
177     public String getState() {
178         return this.state;
179     }
180 
181     public void setState(String state) {
182         this.state = state;
183     }
184 
185     
186 
187 
188 
189     @Column(name = "country", length=50)
190     public String getCountry() {
191         return this.country;
192     }
193 
194     public void setCountry(String country) {
195         this.country = country;
196     }
197 
198     
199 
200 
201 
202 
203     @Column(name = "latitude", length=30)
204     public String getLatitude() {
205         return this.latitude;
206     }
207 
208     public void setLatitude(String latitude) {
209         this.latitude = latitude;
210     }
211 
212     
213 
214 
215 
216 
217     @Column(name = "longitude", length=30)
218     public String getLongitude() {
219         return this.longitude;
220     }
221 
222     public void setLongitude(String longitude) {
223         this.longitude = longitude;
224     }
225 
226     
227 
228 
229 
230     @Column(name = "altitude", length=7)
231     public String getAltitude() {
232         return this.altitude;
233     }
234 
235     public void setAltitude(String altitude) {
236         this.altitude = altitude;
237     }
238 
239     public String toString() {
240         return new ToStringBuilder(this)
241             .append("id", getId())
242             .toString();
243     }
244 
245     public boolean equals(Object o) {
246         if (this == o) return true;
247         if (o == null || getClass() != o.getClass()) return false;
248 
249         AirportBO airportBO = (AirportBO) o;
250 
251         if (altitude != null ? !altitude.equals(airportBO.altitude) : airportBO.altitude != null) return false;
252         if (country != null ? !country.equals(airportBO.country) : airportBO.country != null) return false;
253         if (faa != null ? !faa.equals(airportBO.faa) : airportBO.faa != null) return false;
254         if (iata != null ? !iata.equals(airportBO.iata) : airportBO.iata != null) return false;
255         if (!icao.equals(airportBO.icao)) return false;
256         if (!id.equals(airportBO.id)) return false;
257         if (latitude != null ? !latitude.equals(airportBO.latitude) : airportBO.latitude != null) return false;
258         if (longitude != null ? !longitude.equals(airportBO.longitude) : airportBO.longitude != null) return false;
259         if (municipal != null ? !municipal.equals(airportBO.municipal) : airportBO.municipal != null) return false;
260         if (name != null ? !name.equals(airportBO.name) : airportBO.name != null) return false;
261         if (state != null ? !state.equals(airportBO.state) : airportBO.state != null) return false;
262 
263         return true;
264     }
265 
266     public int hashCode() {
267         int result;
268         result = id.hashCode();
269         result = 31 * result + icao.hashCode();
270         result = 31 * result + (faa != null ? faa.hashCode() : 0);
271         result = 31 * result + (iata != null ? iata.hashCode() : 0);
272         result = 31 * result + (name != null ? name.hashCode() : 0);
273         result = 31 * result + (municipal != null ? municipal.hashCode() : 0);
274         result = 31 * result + (state != null ? state.hashCode() : 0);
275         result = 31 * result + (country != null ? country.hashCode() : 0);
276         result = 31 * result + (latitude != null ? latitude.hashCode() : 0);
277         result = 31 * result + (longitude != null ? longitude.hashCode() : 0);
278         result = 31 * result + (altitude != null ? altitude.hashCode() : 0);
279         return result;
280     }
281 }