Skip Headers

Oracle® Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 2 (10.1.2)
Part No. B15505-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Performing Inner or Outer Joins on One-to-One Relationships

The Oracle database allows you to perform SQL using an inner or outer join. Using a join is more efficient. These are described in the database manuals. However, the definitions from these manuals are as follows:�

For more information on inner and outer joins, see the Oracle database manuals. �

Inside OC4J, if you have specified a one-to-one relationship between two entity beans, you automatically receive an outer join when retrieving data involving this relationship. Previously, OC4J would issue two SQL queries for each side of the relationship. Using the join improves performance by only issuing a single query. �

You can change to using an inner join by modifying the one-to-one-join attribute on the relationship field to inner, as follows:�

<cmr-field-mapping name="inventory" one-to-one-join="inner">

When the one-to-one mapping is unidirectional, place the one-to-one-join attribute on the origination of the relationship. When the relationship is bi-directional, specify the one-to-one-join attribute on both sides of the relationship.�