|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataSetSchemaReader
A DataSetSchemaReader
instantiates DataSets, DataTables and DataRelations from a
schema provider, such as database metadata or XML. The methods for reading schema information
DataSetSchemaReaders
create empty DataSets, DataTables, and DataRelations. The methods
in DataSetSchemaReader
do not specify a data source; implementing classes must do so,
for example in the constructor. For this reason, some DataSetSchemaReaders
may only be
usable with one schema source. Typically the data source will be specified in the constructor to a
DataSetSchemaReader
.
Method Summary | |
---|---|
java.util.List<java.lang.String> |
addRelations(DataSet dataSet,
java.lang.String... tableNames)
Adds all DataRelation for the named DataTable
to the specified DataSet , as read from the schema which this reader
is reading from. |
java.util.List<java.lang.String> |
addTables(DataSet dataSet,
java.lang.String... tableNames)
Appends one or more DataTable to a DataSet
from the schema represented by this reader. |
DataSet |
readDataSet()
Instantiates a new DataSet from the data source
specified in the constructor. |
DataSet |
readDataSet(java.lang.String... tableNames)
Instantiates a new DataSet from the data source specified in the
implementing class, with the DataSet schema loaded but without data, for the tables
and columns given in the tableNames parameter. |
Method Detail |
---|
DataSet readDataSet() throws SchemaReaderException
DataSet
from the data source
specified in the constructor. If the schema contains multiple DataTables
or DataRelations
, all of them are loaded
from the schema into the new DataSet
.
DataSet
instantiated from the data source
specified for the implementing class, including all tables and relations in the schema.
ashktheman.dataset.io.SchemaReaderException
- If an error occurred while loading the schema.
SchemaReaderException
DataSet readDataSet(java.lang.String... tableNames) throws SchemaReaderException
DataSet
from the data source specified in the
implementing class, with the DataSet
schema loaded but without data, for the tables
and columns given in the tableNames
parameter.
tableNames
- One or more table names to load from the schema. Each name can be either a table, or a
table and column, dot-separated. If no columns are specified, all columns in the table are
read from the schema; if columns are listed, only those columns are loaded. DataRelations
for those tables and columns loaded from the schema are also instantiated automatically through
addRelations(org.jdesktop.dataset.DataSet, String...)
.
DataSet
instantiated from the data source
specified for the implementing class, including all tables and relations in the schema.
ashktheman.dataset.io.SchemaReaderException
- If an error occurred while loading the schema.
SchemaReaderException
java.util.List<java.lang.String> addTables(DataSet dataSet, java.lang.String... tableNames) throws SchemaReaderException
DataTable
to a DataSet
from the schema represented by this reader. If the table, by name, is found in the DataSet
,
the table is skipped; if you want to re-add a table (for example, to pick up changes in table structure),
drop the table from the DataSet
before calling this method.
dataSet
- The DataSet
to which to add the tables.tableNames
- One or more table names to load from the schema and add to the DataSet
.
Each name can be either a table, or a table and column, dot-separated.
If no columns are specified, all columns in the table are read from the schema;
if columns are listed, only those columns are loaded. DataRelations
for those tables and columns are not loaded from the schema; to that end, use
addRelations(DataSet, String...)
.
List
of the table names that were actually found. You can check this to
verify that all tables requested were loaded.
org.jdesktop.dataset.io.SchemaReaderException
- If an error occurred while reading the schema.
SchemaReaderException
java.util.List<java.lang.String> addRelations(DataSet dataSet, java.lang.String... tableNames) throws SchemaReaderException
DataRelation
for the named DataTable
to the specified DataSet
, as read from the schema which this reader
is reading from. All DataRelations
for the table are dropped from the DataSet
and re-added.
dataSet
- The DataSet
to which to add the relations.tableNames
- One or more table names for which to read relations from the schema. Only those relations
for columns in the DataTable (as currently loaded) are added.
List
of the DataRelation
names loaded from the schema.#
org.jdesktop.dataset.io.SchemaReaderException
- If an error occurred while reading the schema.
SchemaReaderException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |