addRelation

The addRelation element allows a new relation to be added to the schema.

Example:

<addRelation name="employee2state" type="OneToMany" table="employee" inverseRelationName="state2employee" inverseTable="state_prov">
   <description>my description for employee2state</description>
   <inverseDescription>my description for state2employee</inverseDescription>
</addRelation>

Required Attributes:

Attribute Name

Description

name

Specifies the name of the relation

type

Cardinality of the relation. Valid values are:

  • OneToOne
  • OneToMany
  • ManyToMany

A relation and its inverse relation need only be defined once in a schema script file. Because of this, there is not a need for a ManyToOneRelation (MTO) object.

table

Specifies the name of the table on which this relation should be added.

inverseRelationName

Specifies the name of the inverse relation.

inverseTable

Specifies the name of the table on which the inverse relation should be added.
Note that this inverseTable is where the actual column will be created on for OneToOne and OneToMany relations.


Optional Child Elements:

Element Name

Default

Description

description

 

Description of the relation.

inverseDescription

 

Description of the inverse relation.

exclusiveRelationSet

 

The name of the exclusive relation set to which this relation should be part of.

See Also

schemaScript

addColumn

addExclusiveRelationSet

addIndex

addJoin

addSqlView

addSqlViewColumn

addTable

addView

addViewColumn

updateColumn

updateIndex

updateJoin

updateRelation

updateTable

updateSchema

updateSqlView

updateSqlViewColumn

updateView

updateViewColumn

Next

addSqlView

addRelation