Chapter 7 Generating JDO Persistent Objects


Defining Standard JDO Persistence Descriptors

To customize the generated JDO persistence descriptor and O/R mapping extensions, PowerDesigner uses extended attributes for classes, attributes and associations.

The standard JDO 1.0 persistence descriptor does not support O/R mapping. To define O/R mapping, you must use a JDO product that provides an O/R mapping extension.

Steps To generate a standard JDO persistence descriptor without any extension:

  1. Select Language→Generate Java Code.
  2. Click on the Options tab.
  3. Set the "JDO provider" option to <Standard>
  4. Click Apply to save this option.
  5. Click Cancel to close the window.

By default, PowerDesigner generates a single metadata.jdo file.

Steps To generate a separate .jdo file for each package that contains persistent objects:

  1. Select Language→Generate Java Code.
  2. Click on the Options tab.
  3. Set the "Use a single JDO persistence descriptor for all packages" option to false.
  4. Click Apply to save this option.
  5. Click Cancel to close the window.

If you want to generate a JDO persistence descriptor for a specific JDO product, you still need to configure standard JDO extended attributes.

If a class has primary key attributes, PowerDesigner will generate an inner class to implement the primary key class.

If you use inheritances, only the parent class can have primary key attributes.

 


Copyright (C) 2008. Sybase Inc. All rights reserved.