Register / Login
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Object Relational Mapping
orphanRemoval not working
posted 7 months ago
relation between Flight<-->Tickets and Ticket<-->Passenger
Im using orphanRemoval to remove Ticket link from Flight and Passenger after deleting Ticket
@OneToMany(mappedBy = "flightDetail", orphanRemoval=true) private List<Ticket> tickets;
@ManyToOne @JoinColumn(name = "flight_fk") private Flight flightDetail; @ManyToOne @JoinColumn(name = "paseenger_fk") private Passenger passengerDetail;
@OneToMany(mappedBy = "passengerDetail",orphanRemoval=true) private List<Ticket> tickets;
But even after deleting Ticket it still exist in Flight and Passenger.
Boost this thread!
Deleted object would be re-saved by cascade when deleting a shared child object
Hibernate error when deleting child objects when parent object is deleted
Delete Bidirectional many to one Entities
mappedBy in hibernate what is the advantage
Odd behaviour trying to remove an element from a OneToMany collection