Here, we face a serious problem! We have no guarantees that the data in the database conforms to the rules we defined in our application. If our application, for example, expects and postulates that there can be no order in the system without an associated Customer, and another application that we do not control has written orders to the database that do not have this association, then a subsequent load operation for this order might fail and our application throws an exception.
Is this behavior acceptable? If not, what should we do? Basically, we have two possible strategies: