📄 airport.java
字号:
/* * Airport.java * * Created on Apr 5, 2008, 10:08:49 AM * * To change this template, choose Tools | Templates * and open the template in the editor. */package com.horizongroup.mcompanion.web.model;import java.io.Serializable;import java.util.Collection;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.Id;import javax.persistence.JoinColumn;import javax.persistence.ManyToOne;import javax.persistence.NamedQueries;import javax.persistence.NamedQuery;import javax.persistence.OneToMany;import javax.persistence.Table;/** * * @author User */@Entity@Table(name = "airport")@NamedQueries({@NamedQuery(name = "Airport.findByAirportId", query = "SELECT a FROM Airport a WHERE a.airportId = :airportId"), @NamedQuery(name = "Airport.findByAirportName", query = "SELECT a FROM Airport a WHERE a.airportName = :airportName"), @NamedQuery(name = "Airport.findByAirportType", query = "SELECT a FROM Airport a WHERE a.airportType = :airportType"), @NamedQuery(name = "Airport.findBySpecialities", query = "SELECT a FROM Airport a WHERE a.specialities = :specialities")})public class Airport implements Serializable { @Id @Column(name = "airport_id", nullable = false) private Integer airportId; @Column(name = "airport_name") private String airportName; @Column(name = "airport_type") private String airportType; @Column(name = "SPECIALITIES") private String specialities; @JoinColumn(name = "address_id", referencedColumnName = "address_id") @ManyToOne private Address addressId; @OneToMany(mappedBy = "airportId") private Collection<FlightDetails> flightDetailsCollection; public Airport() { } public Airport(Integer airportId) { this.airportId = airportId; } public Integer getAirportId() { return airportId; } public void setAirportId(Integer airportId) { this.airportId = airportId; } public String getAirportName() { return airportName; } public void setAirportName(String airportName) { this.airportName = airportName; } public String getAirportType() { return airportType; } public void setAirportType(String airportType) { this.airportType = airportType; } public String getSpecialities() { return specialities; } public void setSpecialities(String specialities) { this.specialities = specialities; } public Address getAddressId() { return addressId; } public void setAddressId(Address addressId) { this.addressId = addressId; } public Collection<FlightDetails> getFlightDetailsCollection() { return flightDetailsCollection; } public void setFlightDetailsCollection(Collection<FlightDetails> flightDetailsCollection) { this.flightDetailsCollection = flightDetailsCollection; } @Override public int hashCode() { int hash = 0; hash += (airportId != null ? airportId.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Airport)) { return false; } Airport other = (Airport) object; if ((this.airportId == null && other.airportId != null) || (this.airportId != null && !this.airportId.equals(other.airportId))) { return false; } return true; } @Override public String toString() { return "com.horizongroup.mcompanion.web.model.Airport[airportId=" + airportId + "]"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -