Skip Headers
Oracle® Application Development Framework Developer's Guide
10g (10.1.3.1.0)

Part Number B28967-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

8.2 Identifying Master-Detail Objects on the Data Control Palette

JDeveloper enables you to declaratively create master-detail pages using the Data Control Palette. The Data Control Palette displays master-detail related objects in a hierarchy, where the detail object is displayed as an accessor return under the master object. In the data control, accessor returns are always detail objects in a master-detail relationship.

Figure 8-1 shows the Data Control Palette for the SRDemo application. Because the serviceHistory and ServiceRequest objects have a master-detail relationship, the accessor return serviceHistoryCollection appears under the ServiceRequest method return. In this case, the accessor return is a collection of service history objects related to a service request object. Method returns are always collections, but accessor returns can be either collections or single objects.


Tip:

By default, when data controls are created from TopLink POJOs (or session beans over POJOs), the names of accessor returns that are collections end in Collection. For example, serviceHistoryCollection.

Figure 8-1 Master-Detail Objects on the Data Control Palette

Master-Detail Collections on Data Control Palette

Tip:

The master-detail hierarchy displayed in the Data Control Palette does not reflect the cardinality of the relationship (for example, one-to-many, one-to-one, many-to-many). The hierarchy simply shows which collection (the master) is being use to retrieve one or more objects from another collection (the detail).

When creating a page that displays master-detail objects, be sure to correctly identify which object is the master and which is the detail for your particular purposes. Otherwise, you may not display the desired data on the page.

For example, if you want to display a user and all the related expertise areas to which the user is assigned, then User would be the master object. However, if you wanted to display an expertise area and all the users is assigned to it, then expertiseArea would be the master object. The detail objects displayed on a page depend on which object is the master.


Tip:

In the Data Control Palette, the attributes shared by both the master and detail objects appear under only one of the objects, not both. For example, in the SRDemo application Data Control Palette, the srvId attribute appears under the ServiceRequest master node, but not the serviceHistoryCollection detail node.

Also, in some cases, the master collection appears as an accessor return under a detail collection. For example, in Figure 8-1, ServiceRequest, which is a master collection, appears as an accessor return under the serviceHistoryCollection node, which is a detail collection. In this case, the common attribute shared by these collections creates a recursive relationship in the data control. In most cases, you would never use the accessor return that appears as a result of such a recursion to create a UI component.


For more information about the icons displayed on the Data Control Palette, see Section 5.2.1, "How to Understand the Items on the Data Control Palette".