When a Customer instance is deleted, it is important to be able to delete the CustomerPhone instances at the same time. Here is one way to delete the CustomerPhone objects before deleting the Customer object. This is an integer primary key column that is arbitrarily assigned by the framework. Compound Primary Keys Let's examine what the column specs would look like for a table with compound primary keys like the CustomerPhone table. This would need to be done anyway since we will most certainly need to add and update rows in the CustomerPhone table.
Some tables have a natural primary keys.
Natural primary keys are not generated by the system and must be set by the application. In this section we'll look at how to create your own, custom find SQL if you've gone beyond the easy capabilities of the framework. The Rental table tells us who has which videos checked out. The most direct and simple way would be to have Customer, Video, and Rental persistent objects and domains that would map directly to the underlying tables. This would involve no joins and harmony would exist between the object and relational world.