Removing primary and foreign keys as class propert – Apple WebObjects 3.5 User Manual
Page 98

Chapter 3
Creating a WebObjects Database Application
98
Project Builder opens your model file in EOModeler, launching EOModeler
first if it isn’t already running. EOModeler displays your model in the Model
Editor. It lists the entities for the tables you specified in the wizard—Movie,
MovieRole, and Talent.
Removing Primary and Foreign Keys as Class Properties
By default, EOModeler makes all of an entity’s attributes 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.
2. Click in the Class Property column to remove the
symbol for the
movieId
attribute.
3. Now repeat the previous step to remove
studioId
as a class property.