1   package org.wcb.model.vo.hibernate;
2   
3   import java.io.Serializable;
4   
5   import javax.persistence.*;
6   
7   
8   /**
9    *
10   * This object stores aircraft information.
11   * <small>
12   * Copyright (c)  2006  wbogaardt.
13   * Permission is granted to copy, distribute and/or modify this document
14   * under the terms of the GNU Free Documentation License, Version 1.2
15   * or any later version published by the Free Software Foundation;
16   * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
17   * Texts.  A copy of the license is included in the section entitled "GNU
18   * Free Documentation License".
19   * <p/>
20   * $File:  $ <br>
21   * $Change:  $ submitted by $Author: wbogaardt $ at $DateTime: Mar 30, 2006 10:35:19 AM $ <br>
22   * </small>
23   *
24   * @author wbogaardt
25   * @version 1
26   *          Date: Mar 30, 2006
27   *          Time: 10:35:19 AM
28   */
29  
30  @Entity
31  @Table(name ="aircraft")
32  public class AircraftBO implements Serializable {
33  
34      /** identifier field */
35      private Integer id;
36  
37      /** persistent field */
38      private String registrationNumber;
39  
40      /** persistent field */
41      private int typeId;
42  
43      /** full constructor */
44      public AircraftBO(String registrationNumber, int typeId) {
45          this.registrationNumber = registrationNumber;
46          this.typeId = typeId;
47      }
48  
49      /** default constructor */
50      public AircraftBO() {
51      }
52  
53      /**
54       * The id primary key of the database table.
55       * @return primary key
56       */
57      @Id
58      @GeneratedValue(strategy= GenerationType.AUTO)
59      public Integer getId() {
60          return this.id;
61      }
62  
63      public void setId(Integer id) {
64          this.id = id;
65      }
66  
67      /**
68       * Registration or N-number of the aircraft.
69       * @return registration tail number
70       */
71      @Column(name = "registration_number", nullable=false, length=7)
72      public String getRegistrationNumber() {
73          return this.registrationNumber;
74      }
75  
76      public void setRegistrationNumber(String registrationNumber) {
77          this.registrationNumber = registrationNumber;
78      }
79  
80      /**
81       * Foreign key to type of aircraft.
82       * @return id to type.
83       */
84      @Column(name = "type_id", nullable=false, length=11)
85      public int getTypeId() {
86          return this.typeId;
87      }
88  
89      public void setTypeId(int typeId) {
90          this.typeId = typeId;
91      }
92  
93      //Get the registration number only.
94      public String toString() {
95          return this.registrationNumber;
96      }
97  
98  }