|
|
|
The Model-Driven System Builder
|
|
JeeWiz Architect's Guide
|
|
|
|
Contents >
14. 'Business Object' Reference
|
|
|
14.21 End Object
| Used on |
|
| Superclass | associationEnd |
| Description | Specifies the participation of an entity in a relationship.
This adds a special default for the accessor, which will be the lower-cased name of the entity.
For example, say we have a Order-Customer relation which is many-to-one (many orders can be from one customer, but each order can only come from one customer).
This would be specified as
with the order end labelled as multiple, as you would expect.
This produces
- a get/setCustomer() method on the Order object which takes a single value representing the Customer
- a get/setOrder() method on the Customer object which takes a Collection in .NET, or a Set or Collection in J2EE depending on whether duplicates are allowed.
e.g. very roughly !:
class Order {
Customer get/setCustomer();
}
class Customer {
Collection get/setOrder();
}
Note that the accessor names should reflect 'how you traverse the relationship'.
In other words, how you get from the current End's to the object(s) at the other end.
For example, the accessor generated by default end labelled 'entity="Order"' will be called 'customer'.
This leads to the get/setCustomer methods being generated on the Order.
|
Contained Lists |
| 1 |
|
| |
| 2 |
| Name | rolesReadonly |
| Type | String |
| Inherited from | entity |
|
| |
| 3 |
| Name | rolesAllowed |
| Type | String |
| Inherited from | entity |
|
| |
| 4 |
| Name | rolesBlocked |
| Type | String |
| Inherited from | entity |
|
| |
| 5 |
| Name | keyMap |
| Type | keyMap |
| Description | A list of foreign-key/related-key fields to map from this end's entity to related entities.
|
| GenerateAllList | false |
|
|
| Validation |
1.
The entity property does not name an entity in this jar/assembly
2.
The accessor property after defaults are applied must be non-null
3.
The accessor property after defaults are applied must be non-empty
4.
The accessor must start with a lower-case letter or '_'
5.
end has multiplicity of 'One' and has keymaps - this is incompatible with the other end being 'Many'
6.
if both ends of a relationship are 'One', only one of the ends can have keymaps
7.
If an end has keymaps, the number of keymaps on the end must match the size of the key list on the other end's entity.
|
Inherited properties |
|
14.21.1 Property 'entity'
|
| Description | The name of the participating entity (i.e. the one at 'this end' of the relationship).
The entity must be in the same jar/assembly/ejb-jar as the 'end' object.
|
| Type | String |
| Required | true |
14.21.2 Property 'multiplicity'
|
| Overrides | associationEnd.multiplicity |
| Description | Specifies the multiplicity of the named entity in the relationship. This can be One or Many.
|
| Type | String |
| Choices |
One (default)
Many
|
| Required | true |
14.21.3 Property 'externalName'
|
| Description | This is the external name for the relationship and its accessor,
as it will appear on pages if the relationship is used on a page.
|
| Type | String |
14.21.4 Property 'cascadeDelete'
|
| Description | 'cascade-delete' specifies whether to cascade the delete of this end's entity to the related entity.
|
| Type | boolean |
| Default | false |
14.21.5 Property 'accessNo'
|
| Description | A number placed on the end by the entity, unique to the entity to give a shorter name for paths than
the accessor.
|
| Type | int |
Copyright (c) 2001-2008 New Technology/enterprise Ltd.
| |