Java Reference
In-Depth Information
private Long id;
private boolean booked;
//bi-directional many-to-one association to SeatType
@ManyToOne [1]
@JoinColumn(name="seat_id") [2]
private SeatType seatType;
// Getters and Setters omitted for brevity
As you can see, the Seat entity has the corresponding @ManyToOne [1] annotation,
which naturally complements the @OneToMany relationship. The @JoinColumn [2]
notifies the JPA engine that the seatType field is mapped through the foreign key of the
database's seat ID.
Search WWH ::

Custom Search