Commit fd7477f2 authored by Andrei Zhikulin's avatar Andrei Zhikulin
Browse files

add ManyToMany

parent 28c7eb49
......@@ -34,7 +34,6 @@ public class FlightEntity {
private TerminalEntity terminalByTerminalid;
private List<TicketEntity> ticketsById;
@Id
@Column(name = "id")
public int getId() {
......@@ -160,21 +159,6 @@ public class FlightEntity {
this.airlineByAirlineid = airlineByAirlineid;
}
private Set<PassengerEntity> passengers;
@ManyToMany(cascade = CascadeType.PERSIST, fetch = FetchType.EAGER)
@JoinTable(name = "ticket", joinColumns = @JoinColumn(name = "flightid"),
inverseJoinColumns = @JoinColumn(name = "passengerid"))
public Set<PassengerEntity> getPassengers() {
return passengers;
}
public void setPassengers(Set<PassengerEntity> passengers) {
this.passengers = passengers;
}
@JsonIgnore
@ManyToOne(cascade = {CascadeType.PERSIST})
@JoinColumn(name = "terminalid", referencedColumnName = "id", nullable = false, insertable = false, updatable = false)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment