All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.xmldbms.maps.ClassTableMap

java.lang.Object
   |
   +----org.xmlmiddleware.xmldbms.maps.MapBase
           |
           +----org.xmlmiddleware.xmldbms.maps.ClassTableMap

public class ClassTableMap
extends MapBase
Maps a table to a class; not for general use.

ClassTableMap contains information about a table that is viewed as a class and mapped to an element type. It is optimized for returning arrays of ColumnMaps, PropertyTableMaps, and RelatedClassTableMaps; most other methods require linear searches of one sort or another. This means that map factories will be slower, but data transfer software will be faster.

ClassTableMaps are stored in the XMLDBMSMap object and in RelatedClassTableMap objects.

Version:
2.0
Author:
Ronald Bourret, 1998-9, 2001

Method Index

 o addColumnMap(ColumnMap)
Add a ColumnMap for a column.
 o addPropertyTableMap(PropertyTableMap)
Add a PropertyTableMap.
 o addRelatedClassTableMap(RelatedClassTableMap)
Add a RelatedClassTableMap.
 o create(Table)
Create a new ClassTableMap.
 o createColumnMap(Column)
Create a ColumnMap for a column and add it to this ClassTableMap.
 o createPropertyTableMap(Table)
Create a PropertyTableMap and add it to this ClassTableMap.
 o getBaseLinkInfo()
Get the LinkInfo used to link the class table to the base class table.
 o getBaseTable()
Get the base Table.
 o getColumnMap(String)
Get the ColumnMap for a column.
 o getColumnMaps()
Get the ColumnMaps for all columns.
 o getElementTypeName()
Get the element type name.
 o getPropertyTableMap(String, String, String, String)
Get the PropertyTableMap for a table.
 o getPropertyTableMaps()
Get all PropertyTableMaps.
 o getRelatedClassTableMap(String, String, String, String)
Get the RelatedClassTableMap(s) for a table.
 o getRelatedClassTableMaps()
Get all RelatedClassTableMaps.
 o getTable()
Get the Table that the ClassTableMap maps.
 o removeAllColumnMaps()
Remove the ColumnMaps for all columns.
 o removeAllPropertyTableMaps()
Remove all PropertyTableMaps.
 o removeAllRelatedClassTableMaps()
Remove all RelatedClassTableMaps.
 o removeColumnMap(String)
Remove the ColumnMap for a column.
 o removePropertyTableMap(String, String, String, String)
Remove a PropertyTableMap.
 o removeRelatedClassTableMaps(String, String, String, String)
Remove a RelatedClassTableMap(s).
 o setBaseLinkInfo(LinkInfo)
Set the LinkInfo used to link the table to the base table.
 o setBaseTable(Table)
Set the base Table.
 o setElementTypeName(String, String)
Set the element type name.
 o setElementTypeName(XMLName)
Set the element type name.

Methods

 o create
 public static ClassTableMap create(Table table)
Create a new ClassTableMap.

Parameters:
table - The table being mapped.
Returns:
The ClassTableMap.
 o getTable
 public final Table getTable()
Get the Table that the ClassTableMap maps.

Returns:
The Table.
 o getBaseTable
 public final Table getBaseTable()
Get the base Table.

Returns:
The base Table. Null if no base Table exists.
 o setBaseTable
 public void setBaseTable(Table baseTable)
Set the base Table.

Parameters:
baseTable - The base table. If there is no base table, set this to null, in which case whether to use the base table will be set to false.
 o getBaseLinkInfo
 public final LinkInfo getBaseLinkInfo()
Get the LinkInfo used to link the class table to the base class table.

Returns:
The LinkInfo. The "parent" table is the base class table. Null if the base class table is not used.
 o setBaseLinkInfo
 public void setBaseLinkInfo(LinkInfo baseLinkInfo)
Set the LinkInfo used to link the table to the base table.

This method may not be called if the base table is null.

Setting the baseLinkInfo argument to null when the base table is non-null is useful if you want the map objects to preserve inheritance information but want to store the data for the class in a single table, rather than in a base table and a class table. Inheritance information can then be used elsewhere, such as when an XML Schema is generated from an XMLDBMSMap.

Parameters:
baseLinkInfo - The LinkInfo. The "parent" table is the base table. Null if the base table is not used.
 o getElementTypeName
 public final XMLName getElementTypeName()
Get the element type name.

Returns:
The name of the element type.
 o setElementTypeName
 public void setElementTypeName(String uri,
                                String localName) throws XMLMiddlewareException
Set the element type name.

Parameters:
uri - Namespace URI of the element type. May be null.
localName - Local name of the element type.
Throws: XMLMiddlewareException
Thrown if the element type name has already been mapped.
 o setElementTypeName
 public void setElementTypeName(XMLName elementTypeName) throws XMLMiddlewareException
Set the element type name.

Parameters:
elementTypeName - The element type name.
Throws: XMLMiddlewareException
Thrown if the element type name has already been mapped.
 o getColumnMap
 public final ColumnMap getColumnMap(String columnName)
Get the ColumnMap for a column.

Parameters:
columnName - The column name.
Returns:
A ColumnMap for the column. Null if the column is not mapped.
 o getColumnMaps
 public final Enumeration getColumnMaps()
Get the ColumnMaps for all columns.

Returns:
An Enumeration of the ColumnMaps for all columns. May be empty.
 o createColumnMap
 public ColumnMap createColumnMap(Column column)
Create a ColumnMap for a column and add it to this ClassTableMap.

If the column has already been mapped, returns the existing ColumnMap.

Parameters:
column - The Column being mapped.
Returns:
The ColumnMap for the column.
 o addColumnMap
 public void addColumnMap(ColumnMap columnMap) throws XMLMiddlewareException
Add a ColumnMap for a column.

Parameters:
columnMap - ColumnMap for the column.
Throws: XMLMiddlewareException
Thrown if the column has already been mapped.
 o removeColumnMap
 public void removeColumnMap(String columnName) throws XMLMiddlewareException
Remove the ColumnMap for a column.

Parameters:
columnName - The column name.
Throws: XMLMiddlewareException
Thrown if the column has not been mapped.
 o removeAllColumnMaps
 public void removeAllColumnMaps()
Remove the ColumnMaps for all columns.

 o getRelatedClassTableMap
 public final Enumeration getRelatedClassTableMap(String databaseName,
                                                  String catalogName,
                                                  String schemaName,
                                                  String tableName)
Get the RelatedClassTableMap(s) for a table.

WARNING: There can be more than one RelatedClassTableMap for a single table. This happens when two element types in a content model both inherit from the same complex type. For example, a ShipToAddress and a BillToAddress could both inherit from Address and both be mapped to the Addresses table.

Parameters:
databaseName - Name of the database. If this is null, uses "Default".
catalogName - Name of the catalog. May be null.
schemaName - Name of the schema. May be null.
tableName - Name of the table.
Returns:
An Enumeration of RelatedClassTableMaps. Empty if the table is not mapped as a related class.
 o getRelatedClassTableMaps
 public final Enumeration getRelatedClassTableMaps()
Get all RelatedClassTableMaps.

Returns:
An Enumeration of RelatedClassTableMaps. May be empty.
 o addRelatedClassTableMap
 public void addRelatedClassTableMap(RelatedClassTableMap relatedClassTableMap)
Add a RelatedClassTableMap.

WARNING: This method does not return an error if the table has already been mapped as a related class table. For details, see getRelatedClassTableMap.

If a table is mapped more than once as a related class table, each RelatedClassTableMap must have a different element type name. This is not checked in this method. Instead, it is checked in MapChecker.

Parameters:
relatedClassTableMap - The RelatedClassTableMap.
 o removeRelatedClassTableMaps
 public void removeRelatedClassTableMaps(String databaseName,
                                         String catalogName,
                                         String schemaName,
                                         String tableName) throws XMLMiddlewareException
Remove a RelatedClassTableMap(s).

WARNING: This method removes all RelatedClassTableMaps for the specified table.

Parameters:
databaseName - Name of the database. If this is null, uses "Default".
catalogName - Name of the catalog. May be null.
schemaName - Name of the schema. May be null.
tableName - Name of the table.
Throws: XMLMiddlewareException
Thrown if the related class table has not been mapped.
 o removeAllRelatedClassTableMaps
 public void removeAllRelatedClassTableMaps()
Remove all RelatedClassTableMaps.

 o getPropertyTableMap
 public final PropertyTableMap getPropertyTableMap(String databaseName,
                                                   String catalogName,
                                                   String schemaName,
                                                   String tableName)
Get the PropertyTableMap for a table.

Parameters:
databaseName - Name of the database. If this is null, uses "Default".
catalogName - Name of the catalog. May be null.
schemaName - Name of the schema. May be null.
tableName - Name of the table.
Returns:
A PropertyTableMap. Null if the table is not mapped as a property table.
 o getPropertyTableMaps
 public final Enumeration getPropertyTableMaps()
Get all PropertyTableMaps.

Returns:
An Enumeration of the PropertyTableMaps. May be empty.
 o createPropertyTableMap
 public PropertyTableMap createPropertyTableMap(Table table)
Create a PropertyTableMap and add it to this ClassTableMap.

If the table has already been mapped, returns the existing PropertyTableMap.

Parameters:
table - The property table.
Returns:
The PropertyTableMap.
 o addPropertyTableMap
 public void addPropertyTableMap(PropertyTableMap propTableMap) throws XMLMiddlewareException
Add a PropertyTableMap.

Parameters:
propTableMap - The PropertyTableMap.
Throws: XMLMiddlewareException
Thrown if the property table has already been mapped.
 o removePropertyTableMap
 public void removePropertyTableMap(String databaseName,
                                    String catalogName,
                                    String schemaName,
                                    String tableName) throws XMLMiddlewareException
Remove a PropertyTableMap.

Parameters:
databaseName - Name of the database. If this is null, uses "Default".
catalogName - Name of the catalog. May be null.
schemaName - Name of the schema. May be null.
tableName - Name of the table.
Throws: XMLMiddlewareException
Thrown if the related property table has not been mapped.
 o removeAllPropertyTableMaps
 public void removeAllPropertyTableMaps()
Remove all PropertyTableMaps.


All Packages  Class Hierarchy  This Package  Previous  Next  Index