All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.tudarmstadt.ito.xmldbms.TableMap

java.lang.Object
   |
   +----de.tudarmstadt.ito.xmldbms.TableMap

public class TableMap
extends Object
Maps a table to a class or property; not for general use.

TableMaps contain all the information necessary to map a table to a class or property: table information, class (element type) name, column maps, information about related tables, and so on. Note that the arrays containing information about related tables (relatedTables, parentKeyIsCandidate, parentKeys, childKeys, and orderColumns) are read in parallel and must contain the same number of entries in the same order.

TableMaps are stored in an array in the Map class and in the relatedTableMaps hash table in TableMap, which is keyed by table name.

Version:
1.01
Author:
Ronald Bourret, Technical University of Darmstadt

Variable Index

 o childKeys
An array containing the Columns in each child key used to join the parent table to the child table (see parentKeyIsCandidate).
 o columnMaps
ColumnMaps for each column in the table.
 o elementType
Unprefixed name of the element type to which a class table is mapped.
 o orderColumns
An array containing order Columns and/or nulls.
 o parentKeyIsCandidate
An array stating whether the parent table or the child table contains the candidate key.
 o parentKeys
An array containing the Columns in each parent key used to join the parent table to each child table (see parentKeyIsCandidate).
 o prefixedElementType
Prefixed name of the element type to which a class table is mapped.
 o relatedTables
An array containing a TableMap for each related property table or class table.
 o table
Table object of the mapped table.
 o type
What the table is mapped to: TYPE_CLASSTABLE or TYPE_PROPERTYTABLE.
 o TYPE_CLASSTABLE
Map the table to a class.
 o TYPE_PROPERTYTABLE
Map the table to a property.

Constructor Index

 o TableMap()
Construct a TableMap.
 o TableMap(Table, int, String, String, ColumnMap[], int)
Construct and initialize a TableMap.

Variables

 o TYPE_CLASSTABLE
 public static final int TYPE_CLASSTABLE
Map the table to a class.

 o TYPE_PROPERTYTABLE
 public static final int TYPE_PROPERTYTABLE
Map the table to a property.

 o table
 public Table table
Table object of the mapped table.

 o type
 public int type
What the table is mapped to: TYPE_CLASSTABLE or TYPE_PROPERTYTABLE.

 o elementType
 public String elementType
Unprefixed name of the element type to which a class table is mapped. Null if the table is mapped to a property. In the future, this and prefixedElementType should probably be replaced by an NSName.

See Also:
usePrefixes
 o prefixedElementType
 public String prefixedElementType
Prefixed name of the element type to which a class table is mapped. Null if the table is mapped to a property. In the future, this and elementType should probably be replaced by an NSName.

See Also:
usePrefixes
 o columnMaps
 public ColumnMap columnMaps[]
ColumnMaps for each column in the table.

These must be ordered such that all columns mapped to element types occur before any columns mapped to attributes of these elements or PCDATA. This guarantees that, when retrieving data from the database, the desired element will be available when the attribute column is processed.

A table mapped to a property can contain only one ColumnMap -- that of the column containing the property. In the future, if we allow attributes of element types-as-properties to be stored, then one column map of the property table would map to an element type and all other column maps would map to attributes of that element type.

 o relatedTables
 public TableMap relatedTables[]
An array containing a TableMap for each related property table or class table.

 o parentKeyIsCandidate
 public boolean parentKeyIsCandidate[]
An array stating whether the parent table or the child table contains the candidate key. The parent table is the table described in this TableMap; the child table is the table described in the TableMap in relatedTables. The array must match relatedTables in size and order.

 o parentKeys
 public Column parentKeys[][]
An array containing the Columns in each parent key used to join the parent table to each child table (see parentKeyIsCandidate). The outer array must match relatedTables in size and order.

 o childKeys
 public Column childKeys[][]
An array containing the Columns in each child key used to join the parent table to the child table (see parentKeyIsCandidate). The outer array must match relatedTables in size and order.

 o orderColumns
 public Column orderColumns[]
An array containing order Columns and/or nulls. For related class tables, an entry can be a Column that describes the order in which the class elements are to be created in the parent element or null if there is no such column. For related property tables, an entry is always null, as property order information is stored in the ColumnMap for the column corresponding to the property.

Constructors

 o TableMap
 public TableMap()
Construct a TableMap.

 o TableMap
 public TableMap(Table table,
                 int type,
                 String elementType,
                 String prefixedElementType,
                 ColumnMap columnMaps[],
                 int numRelatedTables)
Construct and initialize a TableMap.


All Packages  Class Hierarchy  This Package  Previous  Next  Index