I have some entities with@ManyToMany
relation:
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "buses_drivers",
joinColumns = @JoinColumn (name = "driver_id_inner", referencedColumnName = "driver_id"),
inverseJoinColumns = @JoinColumn (name = "bus_id_inner", referencedColumnName = "bus_id"))
private List<Bus> buses;
and
@ManyToMany(mappedBy = "buses", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private List<Driver> drivers;
When execute saving Driver
model with some Bus
models, all ok. Tables buses_drivers
store all keys those entities. But when saving Bus
model with drivers, table doesn't change. I think problem with inverseJoinColmns
mapping.