Apple WebObjects 3.5 User Manual
Page 100

Chapter 3
Creating a WebObjects Database Application
100
your relationship, and the relationship’s name is dependent on the adaptor
the wizard used. Adaptors don’t all have the same naming convention for
to-many relationships. For example, the Oracle adaptor names Movie’s
relationship
movieRoleArray
instead of
movieRoles
.
If your Movie entity doesn’t have a
movieRoles
relationship, it means that the
database server’s schema information for your database didn’t have enough
information for the wizard to create them. You need to create them by hand
now. The next several steps explain how.
2. Choose Property
m
Add Relationship.
A new relationship named “Relationship” is added in the table view at the
bottom of the Model Editor. The new relationship is already selected.
3. With the relationship selected in the right frame of the Model Editor, click
the
button (in the toolbar) to inspect the relationship.
4. In the Inspector, select the To Many option.
5. Select MovieRole as the destination entity.
6. Select
movieId
in the Source Attributes list.
7. Select
movieId
in the Destination Attributes list.
Don’t change the relationship’s name, because EOModeler
updates the name for you automatically when you connect
the Destination and Join properties.
First select whether the relationship is to-one or to-many.
Then select a destination entity.
Select a source attribute...
...and a matching destination attribute.
When you’re done, click here.