Integrating legacy databases …
You don t have to join a component; you can as well join individual properties or even a (we did this in the previous chapter for optional entity associations). By setting optional=”true”, you indicate that the component property may also be null for a User with no billingAddress, and that no row should then be inserted into the secondary table. Hibernate also executes an outer join instead of an inner join to retrieve the row from the secondary table. If you declared fetch=”select” on the mapping, a secondary select would be used for that purpose. The notion of a secondary table is also included in the Java Persistence specification. First, you have to declare a secondary table (or several) for a particular entity: @Entity @Table(name = “USERS”) @SecondaryTable( name = “BILLING_ADDRESS”, pkJoinColumns = { @PrimaryKeyJoinColumn(name=”USER_ID”) } ) public class User { … }
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.
This entry was posted
on Friday, February 29th, 2008 at 9:17 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.