You want to make sure that an airline flight in your app cannot be deleted if there are still passengers assigned to it. What should you configure?

0
confused what is deleted here?  
asked
4 answers
0

Hi there!

In other words: an airline flight, for example from Amsterdam to Paris, can only be deleted by a user if there are no passengers assigned to that flight. In other other words, if a plane flies from New Delhi to Mumbai, it should only be deleted (cancelled) if no passengers will fly on the plane.

 

Hope this helps!

 

Maarten

answered
0

Depending on your domain model, if you have an entity for Flight and have it associated with an entity Passenger, then you can set the delete-behavior of that association to only allow a flight to be deleted if no passenger is associated with it.

answered
0

You can double click the association and you can configure on delete options, I think.

answered
0

You should  set a validation to delete action (or change it if already exixts) like this : not(flight_passenger/passenger). This means that there is no object (passenger) that hangt the association between flight and passenger. 

answered