Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Getting Started With WebObjects


   

Removing Foreign Keys as Class Properties

By default, the wizard makes all of an entity's attributes, except primary keys, class properties. When an attribute is a class property, it means that the property is a part of your enterprise object, usually as an instance variable.

You should mark as class properties only those attributes whose values are meaningful in the objects that are created when you fetch from the database. Attributes that are essentially database artifacts, such as primary and foreign keys, shouldn't be marked as class properties unless the key has meaning to the user and must be displayed in the user interface.

Eliminating primary and foreign keys as class properties has no adverse effect on how Enterprise Objects Framework manages enterprise objects in your application.

  1. In the left frame (or tree view), click the Movie entity.

    The right frame switches from a view of the entities in the model to a view of Movie's attributes.

    A symbol in the first column means that the attribute is a primary key for the selected entity. A symbol in the second column means that the attribute is a class property.

  2. Click in the Class Property column to remove the symbol for the studioId attribute, which is a foreign key. The wizard didn't make movieId a class property because it is a primary key.


© 1999 Apple Computer, Inc. – (Last Updated 24 Aug 99)