JeeWiz Home  
The Model-Driven System Builder

JeeWiz Architect's Guide
 
Contents  >   14.  'Business Object' Reference
 


14.33 Relation Object

Used on
serverJar
DescriptionDescribes a container-managed relationship between two entities [e.g. two J2EE entity EJBs in the same ejb-jar].

A relationship allows you 'traverse' from one entity instance to one or more related entity instances. Therefore there are two 'end's to a relationship, describing information related to each instance's view of the relationship - at the very least, what type of entity is at this end!

In design tools, relationships are modelled by drawing an association between the entities. This allows you to name the overall relationship, name the role at each end and the multiplicity (e.g. 1-1, 1-n [or '1-*']).

The related entity instance(s) of an entity instance are calculated by matching corresponding attributes in the two objects. For example, a customer object could find its related accounts by matching the customer number on all account records with its own customer number. More than one attribute can be used in the matching process: each pair of the corresponding attributes are matched individually. The pairs of corresponding attributes are specified in <key-map> sub-elements of the end element. If an end has one or more <key-map> sub-elements, it is possible to traverse from that entity instance to related entity instance(s).

Relationships can be one-way (unidirectional) or two-way (bidirectional). In a one-way relationship, it is possible to 'traverse' only from the first entity instance to the second. One-way relationships have <key-map> sub-elements on one end only. In a two-way relationship, it is also possible to traverse from the second entity instance to the first. Two-way relationships have <key-map> sub-elements on both ends. At least one end of a relationship must have key-maps: it doesn't make sense to have a zero-way relationship!
Contained
Lists
1
Name  end
Type  end
Description  Specifies the two entities that participate in the relationship.
GenerateAllList  true
Validation 1.   Relation requires exactly 2 elements
2.   At least one 'end' must have some key-map elements
Inherited
properties
template (base property)

text (base property)

jwpattern (base property)

 14.33.1  Property 'name'
 14.33.2  Property 'linkTable'
 14.33.3  Property 'generateTableSchema'
 14.33.4  Property 'uid'
 14.33.5  Property 'description'

14.33.1  Property 'name'
DescriptionThe identifier of the relation. This must be unique. If not specified, numeric names are given according to the position of the relation.
TypeString
Default\"" + entityRelationCounter

14.33.2  Property 'linkTable'
Description'link-table' is the name of the database table that links two entities in a many-to-many relationship.

For each association between two entities, a row will be created in the link-table to represent the association.
TypeString

14.33.3  Property 'generateTableSchema'
DescriptionSet this flag to 'true' to generate the table schema for the link table. To prevent the automatic generation, set it to false. This also affects descriptor generation for app servers such as WebSphere. A similar field appears on entity. By default it is set to 'true'.
Typeboolean
Defaulttrue

14.33.4  Property 'uid'
DescriptionThe 'uid' is a Unique IDentifier for a methods in the business object model (and derivatives like J2EE).

The 'uid' uniquely identifies the method, even if the name or signature of the method changes.

This will normally be generated by the modelling tool; if not, it can be entered manually (but make sure it is unique!).
TypeString

14.33.5  Property 'description'
DescriptionOptional description.

Use this to
  1. document the meaning of a particular item
  2. specify functionality at the design stage for implementation later.
TypeString
Support Element Inputstrue
 


Copyright (c) 2001-2008 New Technology/enterprise Ltd.