All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----org.xmlmiddleware.xmldbms.maps.utils.MetadataInitializer
Metadata must be set for any columns for which data is to be transferred. The result of not setting metadata is undefined. Metadata can be set in a number of ways: (1) from a map document, (2) from a database, (3) from a result set, or (4) directly on Column objects.
You can use the methods in this class to set metadata from a database or a result set. When initializing metadata from a database, the "required" argument specifies whether metadata must be found for all tables in the database. In most cases, you set this argument to true. You set it to false if you want to retrieve metadata for some tables from the database, then retrieve metadata for other tables from another source, such as a result set.
You can use XMLDBMSMap.checkMetadata() to determine if metadata has been set for all tables.
The methods in this class overwrite any existing metadata for tables for which they find metadata.
public MetadataInitializer(XMLDBMSMap map)
public void initializeMetadata(String databaseName, Connection conn, boolean required) throws XMLMiddlewareException
public void initializeMetadata(String databaseNames[], Connection conns[], boolean required) throws XMLMiddlewareException
public void initializeMetadata(String databaseName, String catalogName, String schemaName, String tableName, ResultSet rs) throws XMLMiddlewareException
This method initializes metadata only for the specified table. (This is the "table" that maps the result set.) This method does not affect metadata for other tables. Thus, it can be called for different tables, such as when multiple result sets are passed to DBMSToDOM.retrieveDocument.
This method is liberal with respect to metadata. That is, if any columns in the result set are not mapped, or if any columns in the specified table are not in the result set, they are ignored. This allows a single mapping to be used for multiple result sets based on the same table.
public void initializeMetadata(Table table, ResultSet rs) throws XMLMiddlewareException
This method initializes metadata only for the specified table. (This is the "table" that maps the result set.) This method does not affect metadata for other tables. Thus, it can be called for different tables, such as when multiple result sets are passed to DBMSToDOM.retrieveDocument.
This method is liberal with respect to metadata. That is, if any columns in the result set are not mapped, or if any columns in the specified table are not in the result set, they are ignored. This allows a single mapping to be used for multiple result sets based on the same table.
All Packages Class Hierarchy This Package Previous Next Index