Mapping Oracle Object Types to CMP Fields

That database table managing your CMP persistence may include columns containing Oracle Object types. When you based fields on these columns, you may not have had a domain available to map the object types. This procedure tells you how to create a domain and map the object type to the domain after creating the EJB.

To map an Oracle Object Type to a CMP field:

  1. When you create the bean, base the field on the appropriate database coulmn. Accept the default type mapping for now.
  2. Create a persistence object for the bean.
  3. In the Navigator, right-click the persistence object.
  4. Choose Edit.
  5. Select the Attribute Settings tab.
  6. From the Select Attribute dropdown list, select the field that maps to the object type.
  7. Open the Type dropdown list.

    One of the selections will be a domain named after the object type, even if no such domain exists.
  8. Select the domain.
  9. Click Finish.

    JDeveloper will create the appropriate domain and make the EJB field of that type.