The Bank sample uses a one-to-one relationship for the VapAddress and the VapCustomer business objects. This topic explains how to create a one-to-one relationship using the ObjectExtender tools.
Do the following:
The Customer-BillingAddress class association is an example of a one-to-one relationship.
It was created as follows:
This launches the Association Editor.
This means VapAddress can be obtained from the VapCustomer object.
Leave Many and Required unselected. This sets a cardinality of zero-to-one (0:1). When a cardinality of one-to-one (1:1) is desired, select Required.
This means VapCustomer can be obtained from the VapAddress object.
Leave Many and Required unselected.
You are now done with the Model Browser. The one-to-one relationship is defined.
Next, defining this relationship using schema semantics is shown. Mapping the schema to the model will be the last step covered. These combined tasks provide the required information for creating persistence support for your business objects.
Do the following:
The customer-billingaddress foreign key relationship is the one-to-one relationship that corresponds to the Customer-BillingAddress class association (relationship).
It was created as follows:
This launches the Foreign Key Relationship editor.
The Primary key column (read-only) will be updated with the primary key from the table.
In the Foreign key column, select the foreign key in the CUSTOMER table which corresponds to the billing address, BILLADDR.
You are now done with the Schema Browser.
To complete the last step in defining the persistence layer for the one-to-one relationship.
The (r) billingAddress(customer-billingAddress) property map represents the mapping from the billingAddress attribute from VapCustomer to the customer-billingAddress foreign key relationship.
It was created as follows:
This launches the Property Map Editor.
This concludes defining the persistence layer for the one-to-one relationship.