Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers 10g (10.1.3.1.0) Part Number B25947-01 |
|
|
View PDF |
JDeveloper enables you to declaratively create pages that display master-detail data using the Data Control Palette. The Data Control Palette displays master-detail related objects in a hierarchy that mirrors the one you defined in the application module data model, where the detail objects are children of the master objects. For information about adding master-detail objects to the data model, see Section 5.10.4.3, "How to Enable Active Master/Detail Coordination in the Data Model".
Figure 15-1 shows two master-detail related collections in the Data Control Palette of the SRDemo application. The ServiceRequests
collection is an instance of the ServiceRequests
view object, and the ServiceHistories
collection, which appears as a child of the ServiceRequests
collection, is an instance of the ServiceHistories
view object. The master-detail hierarchy on the Data Control Palette reflects the hierarchy defined in the SRService
application module data model, as shown in Figure 15-2. The hierarchy was established by creating a view link from the ServiceRequests
view object to the ServiceHistories
view object. Next, an instance of the resulting detail view object, ServiceHistories via ServicesHistoriesForServiceRequest1
, has been added to the application module data model, and named ServiceHistories
, as shown in Figure 15-2.
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). |
In the SRDemo application, the view link between the ServiceRequests
view object and ServiceHistories
view object is a one-way relationship. If the view link was bi-directional and both sets of master and detail view objects were added to the application module data model, then the Data Control Palette would also display the ServiceHistories
collection at the same node level as the ServiceRequests
collection, and the detail instance of the ServiceRequests
collection as child of the ServiceHistories
collection.
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: By default, when you define a view link using the Create View Link wizard, the source view object is the master and the destination view object is the detail. However, if you choose to generate accessors in both the source and the destination view objects, then the master-detail relationship is bi-directional. If both sets of master-detail view objects resulting from a bi-directional view link are added to the application module data model, then instances of both sets of view objects will appear independently on the Data Control Palette. |
For more information about the icons displayed on the Data Control Palette, see Section 12.2.1, "How to Understand the Items on the Data Control Palette".