Integrating legacy databases Another, even more exotic use case for the element is inverse joined properties or components. Inverse joined properties Let s assume that in CaveatEmptor you have a legacy table called DAILY_BILLING. This table contains all the open payments, executed in a nightly batch, for any auctions. The table has a foreign key column to ITEM, as you can see in figure 8.5. Each payment includes a TOTAL column with the amount of money that will be billed. In CaveatEmptor, it would be convenient if you could access the price of a particular auction by calling anItem.getBillingTotal(). You can map the column from the DAILY_BILLING table into the Item class. However, you never insert or update it from this side; it s read-only. For that reason, you map it inverse a simple mirror of the (supposed, you don t map it here) other side that takes care of maintaining the column value: …
Figure 8.5 The daily billing summary references an item and contains the total sum.
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.
This entry was posted
on Saturday, March 1st, 2008 at 5:18 am and is filed under PHP5.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.