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   * This object stores aircraft type.
12   * <small>
13   * Copyright (c)  2006  wbogaardt.
14   * Permission is granted to copy, distribute and/or modify this document
15   * under the terms of the GNU Free Documentation License, Version 1.2
16   * or any later version published by the Free Software Foundation;
17   * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
18   * Texts.  A copy of the license is included in the section entitled "GNU
19   * Free Documentation License".
20   * <p/>
21   * $File:  $ <br>
22   * $Change:  $ submitted by $Author: wbogaardt $ at $DateTime: Mar 30, 2006 10:35:19 AM $ <br>
23   * </small>
24   *
25   * @author wbogaardt
26   * @version 1
27   *          Date: Mar 30, 2006
28   *          Time: 10:35:19 AM
29   */
30  @Entity
31  @Table(name ="aircraft_type")
32  public class AircraftTypeBO implements Serializable {
33  
34      /** identifier field */
35      private Integer id;
36  
37      /** nullable persistent field */
38      private String manufacturer;
39  
40      /** nullable persistent field */
41      private String model;
42  
43      /** nullable persistent field */
44      private String abbreviation;
45  
46      /** nullable persistent field */
47      private Integer characteristics;
48  
49      /** full constructor */
50      public AircraftTypeBO(String manufacturer, String model, String abbreviation, Integer characteristics) {
51          this.manufacturer = manufacturer;
52          this.model = model;
53          this.abbreviation = abbreviation;
54          this.characteristics = characteristics;
55      }
56  
57      /** default constructor */
58      public AircraftTypeBO() {
59      }
60  
61      /**
62       * The id primary key of the database table.
63       * @return primary key
64       */
65      @Id
66      @GeneratedValue(strategy= GenerationType.AUTO)
67      public Integer getId() {
68          return this.id;
69      }
70  
71      public void setId(Integer id) {
72          this.id = id;
73      }
74  
75      /**
76       * The manufacture company of the aircraft.
77       * @return manufacture name
78       */
79      @Column(name = "manufacturer", length=20)
80      public String getManufacturer() {
81          return this.manufacturer;
82      }
83  
84      public void setManufacturer(String manufacturer) {
85          this.manufacturer = manufacturer;
86      }
87  
88      /**
89       * Aircraft model type.
90       * @return aircraft type.
91       */
92      @Column(name = "model", length=20)
93      public String getModel() {
94          return this.model;
95      }
96  
97      public void setModel(String model) {
98          this.model = model;
99      }
100 
101     /**
102      * Abreviation of aircraft model and type. Example Cessna 150
103      * is C-150
104      * @return abbreviation of aircraft.
105      */
106     @Column(name = "abbreviation", length=20)
107     public String getAbbreviation() {
108         return this.abbreviation;
109     }
110 
111     public void setAbbreviation(String abbreviation) {
112         this.abbreviation = abbreviation;
113     }
114 
115     /**
116      * Cahracteristics of aircraft type. This is not
117      * determined yet.
118      * @return characteristics.
119      */
120     @Column(name = "characteristics", length=11)
121     public Integer getCharacteristics() {
122         if (this.characteristics == null) {
123             this.characteristics = 1;
124         }
125         return this.characteristics;
126     }
127 
128     public void setCharacteristics(Integer characteristics) {
129         this.characteristics = characteristics;
130     }
131 
132     public String toString() {
133         return new ToStringBuilder(this)
134             .append("id", getId())
135             .toString();
136     }
137 
138 }