FileDocCategorySizeDatePackage
MappingRelationshipElement.javaAPI DocGlassfish v2 API4711Fri May 04 22:34:44 BST 2007com.sun.jdo.api.persistence.model.mapping

MappingRelationshipElement

public interface MappingRelationshipElement implements MappingFieldElement
This is a specialized field element which represents a relationship between two classes. The mapping portion should be set up as follows: When mapping a non-join table relationship, call the {@link #addColumn} method once with each pair of columns between the local table and the foreign table. When mapping a join table relationship, call the {@link #addLocalColumn} once for each pair of columns between the local table and the join table and {@link #addAssociatedColumn} once for each pair of columns between the join table and the foreign table. Note that the number of pairs (local and associated) may differ and that the order of adding them (local first or associated first) is not important.
author
Mark Munro
author
Rochelle Raccah
version
%I%

Fields Summary
Constructors Summary
Methods Summary
public voidaddAssociatedColumn(org.netbeans.modules.dbschema.ColumnPairElement column)
Adds a column to the list of associated columns mapped by this mapping field. Call this method instead of addColumn when mapping join tables. This method is used to map between the join table column and the foreign table column, while addLocalColumn is used to map between the local table and the join table.

param
column foreign column element to be added to the mapping
exception
ModelException if impossible
see
MappingFieldElement#addColumn
see
#addLocalColumn

public voidaddLocalColumn(org.netbeans.modules.dbschema.ColumnPairElement column)
Adds a column to the list of columns mapped by this mapping field. Call this method instead of addColumn when mapping join tables. This method is used to map between the local column and the join table, while addAssociatedColumn is used to map between the join table and the foreign table.

param
column foreign column element to be added to the mapping
exception
ModelException if impossible
see
MappingFieldElement#addColumn
see
#addAssociatedColumn

public java.util.ArrayListgetAssociatedColumns()
Returns the list of associated column names to which this mapping field is mapped. This is used for join tables.

return
the names of the columns mapped by this mapping field
see
MappingFieldElement#getColumns