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
-
addColumnMap(ColumnMap)
- Add a ColumnMap for a column.
-
addPropertyTableMap(PropertyTableMap)
- Add a PropertyTableMap.
-
addRelatedClassTableMap(RelatedClassTableMap)
- Add a RelatedClassTableMap.
-
create(Table)
- Create a new ClassTableMap.
-
createColumnMap(Column)
- Create a ColumnMap for a column and add it to this ClassTableMap.
-
createPropertyTableMap(Table)
- Create a PropertyTableMap and add it to this ClassTableMap.
-
getBaseLinkInfo()
- Get the LinkInfo used to link the class table to the base class table.
-
getBaseTable()
- Get the base Table.
-
getColumnMap(String)
- Get the ColumnMap for a column.
-
getColumnMaps()
- Get the ColumnMaps for all columns.
-
getElementTypeName()
- Get the element type name.
-
getPropertyTableMap(String, String, String, String)
- Get the PropertyTableMap for a table.
-
getPropertyTableMaps()
- Get all PropertyTableMaps.
-
getRelatedClassTableMap(String, String, String, String)
- Get the RelatedClassTableMap(s) for a table.
-
getRelatedClassTableMaps()
- Get all RelatedClassTableMaps.
-
getTable()
- Get the Table that the ClassTableMap maps.
-
removeAllColumnMaps()
- Remove the ColumnMaps for all columns.
-
removeAllPropertyTableMaps()
- Remove all PropertyTableMaps.
-
removeAllRelatedClassTableMaps()
- Remove all RelatedClassTableMaps.
-
removeColumnMap(String)
- Remove the ColumnMap for a column.
-
removePropertyTableMap(String, String, String, String)
- Remove a PropertyTableMap.
-
removeRelatedClassTableMaps(String, String, String, String)
- Remove a RelatedClassTableMap(s).
-
setBaseLinkInfo(LinkInfo)
- Set the LinkInfo used to link the table to the base table.
-
setBaseTable(Table)
- Set the base Table.
-
setElementTypeName(String, String)
- Set the element type name.
-
setElementTypeName(XMLName)
- Set the element type name.
create
public static ClassTableMap create(Table table)
- Create a new ClassTableMap.
- Parameters:
- table - The table being mapped.
- Returns:
- The ClassTableMap.
getTable
public final Table getTable()
- Get the Table that the ClassTableMap maps.
- Returns:
- The Table.
getBaseTable
public final Table getBaseTable()
- Get the base Table.
- Returns:
- The base Table. Null if no base Table exists.
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.
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.
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.
getElementTypeName
public final XMLName getElementTypeName()
- Get the element type name.
- Returns:
- The name of the element type.
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.
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.
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.
getColumnMaps
public final Enumeration getColumnMaps()
- Get the ColumnMaps for all columns.
- Returns:
- An Enumeration of the ColumnMaps for all columns. May be empty.
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.
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.
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.
removeAllColumnMaps
public void removeAllColumnMaps()
- Remove the ColumnMaps for all columns.
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.
getRelatedClassTableMaps
public final Enumeration getRelatedClassTableMaps()
- Get all RelatedClassTableMaps.
- Returns:
- An Enumeration of RelatedClassTableMaps. May be empty.
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.
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.
removeAllRelatedClassTableMaps
public void removeAllRelatedClassTableMaps()
- Remove all RelatedClassTableMaps.
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.
getPropertyTableMaps
public final Enumeration getPropertyTableMaps()
- Get all PropertyTableMaps.
- Returns:
- An Enumeration of the PropertyTableMaps. May be empty.
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.
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.
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.
removeAllPropertyTableMaps
public void removeAllPropertyTableMaps()
- Remove all PropertyTableMaps.
All Packages Class Hierarchy This Package Previous Next Index