In Chapter 11, “Container-managed entity bean development” on page 397, we used an iterative process and meet-in-the-middle mapping between our entity model and the existing tables.
Now let us look at bottom-up and top-down mapping.
Bottom-up mapping from the EJBBANK database
To illustrate the bottom-up process, we create an entity model from the existing tables.
Originally we had an address column in the CUSTOMER table and an ADDRESS table that was related to the CUSTOMER table. Bottom-up does not work for such a combination, because the Customer entity bean would have an address CMP attribute and an address CMR relationship.
We renamed the ADDRESS table to CUSTADDRESS to get around this problem.