This is the @JoinColumn you need, not @Column.
@OneToOne(fetch=FetchType.LAZY,optional=false)
@JoinColumn(name="airportFrom", referencedColumnName="airportId")
public Airport getAirportFrom(){
return this.airportFrom;
}
etc.
(and, as Frothow noted, it would be a little strange for Flights if the flights were OneToOne with airports. I must admit that I usually ignored the domain and assumed that the names were pseudo-nonsense to ease the matter :))
source
share