org.jdesktop.dataset.io.schema
Interface DataSetSchemaWriter

All Known Implementing Classes:
XMLDataSetSchemaWriter

public interface DataSetSchemaWriter

A DataSetSchemaWriter "exports" or "write" a DataSet's schema to some external format, such as XML or SQL DDL. Implementing classes must be able to write the entire DataSet, or a subset of it, given a list of tables. By agreement, the exported schema should be re-loadable (using a DataSetSchemaReader) into a working DataSet, but this may not be possible, depending on the exported format. For example, a writer may output Data Definition Language (SQL) scripts corresponding to a DataSet, but there may not be a parser available for that DDL, or the DDL may not correspond exactly to the DDL returned from a database administration tool, due to information that is simply lacking from the DataSet. This limitation should be noted by implementing classes.

The output format, and output sink, is undefined in the interface, and would typically be specified in the constructor of the implementing class.

Author:
Patrick Wright

Method Summary
 void writeDataSet(DataSet ds)
          Writes an entire DataSet out to some export format, defined by the implementing class.
 void writeDataSet(DataSet ds, java.lang.String... tableNames)
          Writes a subset of a DataSet's schema out to some export format, for the tables given as an argument, in a format defined by the implementing class.
 

Method Detail

writeDataSet

void writeDataSet(DataSet ds)
                  throws SchemaWriterException
Writes an entire DataSet out to some export format, defined by the implementing class. All tables and relations are written out on calling this command. Note only the DataSet schema, not any data, is exported.

Parameters:
ds - The DataSet to write out.
Throws:
SchemaWriterException - If any error occurs while writing the schema.

writeDataSet

void writeDataSet(DataSet ds,
                  java.lang.String... tableNames)
                  throws SchemaWriterException
Writes a subset of a DataSet's schema out to some export format, for the tables given as an argument, in a format defined by the implementing class. The named tables and their relations are written out on calling this command. Note only the DataSet schema, not any data, is exported.

Parameters:
ds - The DataSet to write out.
tableNames - List of DataTable names to write out; the schemas for these tables, and their relations, will be written.
Throws:
SchemaWriterException - If any error occurs while exporting the schema.


Copyright © 2005 Sun Microsystems All Rights Reserved.