|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MappingTableElement
This is an element which represents a database table. It exists (separately from TableElement in the database model) to allow the runtime to use a description of the underlying table that differs from the actual database. For example, mapping table contains a key which can be thought of as a "fake primary key" and designates the columns which the runtime will use to identify rows. It is analagous to the primary key of the underlying database table and is typically the same, however the important point is that it is not a requirement. The table in the database may have a different primary key or may have no primary key at all. Similarly, the mapping table contains a list of reference keys which can be thought of as "fake foreign key" objects and designate the column pairs used to join the primary table with a secondary table. These are analagous to foreign keys and may in fact contain identical pairs as the foreign key, but again, 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. Any mapping table elements which are designated as primary tables have their key set up automatically. Any mapping table elements which are designated as secondary tables should not have their keys set up directly; the setup is automatically part of the pair definition which makes up the reference 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 |
addKeyColumn(org.netbeans.modules.dbschema.ColumnElement column)
Adds a column to the primary key of columns in this mapping table. |
void |
addReferencingKey(MappingReferenceKeyElement referencingKey)
Adds a referencing key to the list of keys in this mapping table. |
ArrayList |
getKey()
Returns the list of column names in the primary key for this mapping table. |
ArrayList |
getReferencingKeys()
Returns the list of keys (MappingReferenceKeyElements) for this mapping table. |
String |
getTable()
Returns the name of the table element used by this mapping table. |
boolean |
isEqual(org.netbeans.modules.dbschema.TableElement table)
Returns true if the table element used by this mapping table is equal to the supplied table. |
void |
removeKeyColumn(String columnName)
Removes a column from the primary key of columns in this mapping table. |
void |
removeReference(MappingTableElement table)
Removes the referencing key for the supplied table element from list of keys in this mapping table. |
void |
setTable(org.netbeans.modules.dbschema.TableElement table)
Set the table element for this mapping table 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 |
| Method Detail |
|---|
String getTable()
void setTable(org.netbeans.modules.dbschema.TableElement table)
throws ModelException
table - table element to be used by the mapping table.
ModelException - if impossibleboolean isEqual(org.netbeans.modules.dbschema.TableElement table)
true if table elements are equal,
false otherwise.ArrayList getKey()
void addKeyColumn(org.netbeans.modules.dbschema.ColumnElement column)
throws ModelException
column - column element to be added
ModelException - if impossible
void removeKeyColumn(String columnName)
throws ModelException
columnName - the relative name of the column to be removed
ModelException - if impossibleArrayList getReferencingKeys()
void addReferencingKey(MappingReferenceKeyElement referencingKey)
throws ModelException
referencingKey - referencing key element to be added
ModelException - if impossible
void removeReference(MappingTableElement table)
throws ModelException
table - mapping table element for which to remove referencing keys
ModelException - if impossible
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||