Specifying a Bean Attribute as a Primary Key

If your business service is a bean-based, such as a TopLink Mapping object, EJB component, or JavaBeans component, and you want to use the ADF operation setCurrentRowWithKeyValue to locate the current object of the bean, you must select an attribute and make it a primary key. In the terminology of relational databases, a primary key uniquely identifies each record in the table. Similarly, when setting an attribute for your bean-based business service as a primary key, the attribute must be guaranteed to contain unique values. You specify this information in the metadata (XML) file for the bean via the Property Inspector.

To specify the primary key for a Bean:

  1. In the Navigator, select the bean's metadata file ( <beanclassname>.xml).
  2. In the Structure pane, select the attribute that you want to make a primary key.
  3. Open the Property Inspector by clicking the V iew menu and choosing Property Inspector .
  4. Select the Primary Key field and choose True from the dropdown list.
  5. Save the <beanclassname>Xml file with the change.

Inserting a URL to Pass Current Row Information to the ADF Binding Context

 

Copyright © 1997, 2004, Oracle. All rights reserved.