|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MappingReferenceKeyElement
This is an element which represents a relationship between two tables (primary and secondary). It should not be used for relationship fields (MappingRelationshipElement has its own set of pairs). It can be thought of as a "fake foreign key" meaning it designates the column pairs used to join the primary table with a secondary table. It is analagous to a foreign key and may in fact contain identical pairs as the foreign key, but this is not a requirement. The foreign key may define a different set of pairs or may not exist at all. Although any set of pairs is legal, the user should be careful to define pairs which represent a logical relationship between the two tables. The relationship should be set up as follows: First, set a primary table for the mapping class. Doing this sets up a "fake primary key" for the associated mapping table element. Next, add a secondary table and set up the pairs which establish the connection on the returned reference key object. This sets up whatever "fake primary key" information is necessary on the secondary table's mapping table, establishes the primary to secondary relationship via the reference keys, and puts the pair information into the "fake foreign key".
| Field Summary |
|---|
| Fields inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElementProperties |
|---|
PROP_ASSOCIATED_COLUMNS, PROP_COLUMNS, PROP_CONSISTENCY, PROP_DATABASE_ROOT, PROP_FETCH_GROUP, PROP_FIELDS, PROP_IN_CONCURRENCY_CHECK, PROP_KEY_COLUMNS, PROP_MODIFIED, PROP_NAME, PROP_NAVIGABLE, PROP_READ_ONLY, PROP_REFERENCING_KEYS, PROP_TABLE, PROP_TABLES, PROP_VERSION_FIELD |
| Method Summary | |
|---|---|
void |
addColumnPair(org.netbeans.modules.dbschema.ColumnPairElement pair)
Add a new column pair to the holder. |
void |
addColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
Add some new column pairs to the holder. |
ArrayList |
getColumnPairNames()
Returns the list of relative column pair names in this referencing key. |
MappingTableElement |
getTable()
Returns the mapping table element for this referencing key. |
void |
removeColumnPair(org.netbeans.modules.dbschema.ColumnPairElement pair)
Remove a column pair from the holder. |
void |
removeColumnPair(String pairName)
Remove a column pair from the holder. |
void |
removeColumnPairs(ArrayList pairNames)
Remove some column pairs from the holder. |
void |
removeColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
Remove some column pairs from the holder. |
void |
setColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
Set the column pairs for this holder. |
void |
setTable(MappingTableElement table)
Set the mapping table for this referencing key to the supplied table. |
| Methods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingMemberElement |
|---|
getDeclaringClass |
| Methods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElement |
|---|
addPropertyChangeListener, addVetoableChangeListener, getName, removePropertyChangeListener, removeVetoableChangeListener, setName |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Methods inherited from interface org.netbeans.modules.dbschema.ReferenceKey |
|---|
getDeclaringTable, getKeyName, getLocalColumns, getReferencedColumns, getReferencedTable, setDeclaringTable, setKeyName |
| Methods inherited from interface org.netbeans.modules.dbschema.ColumnPairElementHolder |
|---|
getColumnPair, getColumnPairs |
| Method Detail |
|---|
MappingTableElement getTable()
void setTable(MappingTableElement table)
throws ModelException
table - mapping table element to be used with this key.
ModelException - if impossibleArrayList getColumnPairNames()
void removeColumnPair(String pairName)
throws ModelException
pairName - the relative name of the column pair to remove
ModelException - if impossible
void removeColumnPairs(ArrayList pairNames)
throws ModelException
pairNames - the relative names of the column pairs to remove
ModelException - if impossible
void addColumnPair(org.netbeans.modules.dbschema.ColumnPairElement pair)
throws ModelException
addColumnPair in interface org.netbeans.modules.dbschema.ColumnPairElementHolderpair - the pair to add
ModelException - if impossible
void addColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
throws ModelException
addColumnPairs in interface org.netbeans.modules.dbschema.ColumnPairElementHolderpairs - the column pairs to add
ModelException - if impossible
void removeColumnPair(org.netbeans.modules.dbschema.ColumnPairElement pair)
throws ModelException
removeColumnPair in interface org.netbeans.modules.dbschema.ColumnPairElementHolderpair - the column pair to remove
ModelException - if impossible
void removeColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
throws ModelException
removeColumnPairs in interface org.netbeans.modules.dbschema.ColumnPairElementHolderpairs - the column pairs to remove
ModelException - if impossible
void setColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
throws ModelException
setColumnPairs in interface org.netbeans.modules.dbschema.ColumnPairElementHolderpairs - the new column pairs
ModelException - if impossible
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||