gistoolkit.datasources
Class SimpleJoinDataSource

java.lang.Object
  extended bygistoolkit.datasources.SimpleDataSource
      extended bygistoolkit.datasources.SimpleJoinDataSource
All Implemented Interfaces:
DataSource
Direct Known Subclasses:
DbaseFileJoinDataSource, SimpleJoinDBDataSource

public abstract class SimpleJoinDataSource
extends SimpleDataSource

Super class for joining tabular information to shape information. The shape information will be retrieved from the source data source. The data in the source data source will be read and joined in code with tabular data retrieved by this data source. The resulting data will be combined and returned to the client as a single table with the attributes of both tables, and the shapes of the source data source. Set the column from the source data that is to be used with the setDatasourceJoinColumn method, and set the column for this data source with the setTableJoinColumn method. The data source first reads the data from the source datasource, then it compares the data from the join data source to that of the source data source, and throws away any that do not have a match. It also trims the source data source to the envelope. This results in a standard inner join between the source data, and the join data.


Field Summary
 
Fields inherited from class gistoolkit.datasources.SimpleDataSource
myTypes
 
Constructor Summary
SimpleJoinDataSource()
          For use with configuration only where the source data source is to be set with the setNode() function.
SimpleJoinDataSource(DataSource inSourceDataSource)
          Create a new DB2JoinDataSource with this data source as the source node.
 
Method Summary
 java.lang.String getDatasourceJoinColumn()
          Get the name of the DB2 column to join with.
 Record getDatasourceRecord(java.lang.Object inKey)
          Return the data source record associated with this key.
 DataSource getJoinDataSource()
          Retrieve the joined datasource.
protected  java.lang.String[] getJoinDataSourceAttributeNames()
          return the datasource attribute names.
protected  AttributeType[] getJoinDataSourceAttributeTypes()
          Method to return the attribute types for the data source.
 boolean getJoinedDataCached()
          true to indicate that the joined datasource should be queried for all of it's records, the records cached, and then joined to the db2 data or false to indicate that the joined datasource should be queried on the fly for it's records, and then those records joined to the DB2 data.
 Node getNode()
          Get the configuration information for this data source
 java.lang.String getTableJoinColumn()
          Get the name of the DB2 column to join with.
 void readDataSource(Envelope inEnvelope)
          Read the data for the joined data source.
 Envelope readEnvelope()
          Returns the bounding rectangle of all the shapes in the Data Source.
protected abstract  GISDataset readShapes(Envelope inEnvelope)
          This method should return the shapes from the data source
 void setDatasourceJoinColumn(java.lang.String inColumnName)
          Set the name of the datasource column to join with.
 void setJoinedDataCached(boolean inCached)
          true to indicate that the joined datasource should be queried for all of it's records, the records cached, and then joined to the db2 data or false to indicate that the joined datasource should be queried on the fly for it's records, and then those records joined to the DB2 data.
 void setNode(Node inNode)
          Set the configuration information for this data source
 void setTableJoinColumn(java.lang.String inColumnName)
          Set the name of the datasource column to join with.
 
Methods inherited from class gistoolkit.datasources.SimpleDataSource
addDataSourceListener, clearCache, commit, delete, doCommit, doDelete, doInsert, doRollback, doUpdate, filterDataset, fireCommit, fireDelete, fireInsert, fireRead, fireRollBack, fireUpdate, getCached, getCacheDataset, getCacheEnvelope, getEnvelope, getFilter, getFromProjection, getName, getStyle, getToProjection, getValidShapeTypes, insert, isCachedProjected, isUpdateable, projectBackward, projectForward, queryFromCache, readDataset, readDataset, removeDataSourceListener, rollback, setCache, setCached, setFilter, setFromProjection, setName, setProjection, setToProjection, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleJoinDataSource

public SimpleJoinDataSource()
For use with configuration only where the source data source is to be set with the setNode() function.


SimpleJoinDataSource

public SimpleJoinDataSource(DataSource inSourceDataSource)
Create a new DB2JoinDataSource with this data source as the source node.

Method Detail

setDatasourceJoinColumn

public void setDatasourceJoinColumn(java.lang.String inColumnName)
Set the name of the datasource column to join with.


getDatasourceJoinColumn

public java.lang.String getDatasourceJoinColumn()
Get the name of the DB2 column to join with.


setTableJoinColumn

public void setTableJoinColumn(java.lang.String inColumnName)
Set the name of the datasource column to join with.


getTableJoinColumn

public java.lang.String getTableJoinColumn()
Get the name of the DB2 column to join with.


setJoinedDataCached

public void setJoinedDataCached(boolean inCached)
true to indicate that the joined datasource should be queried for all of it's records, the records cached, and then joined to the db2 data or false to indicate that the joined datasource should be queried on the fly for it's records, and then those records joined to the DB2 data.


getJoinedDataCached

public boolean getJoinedDataCached()
true to indicate that the joined datasource should be queried for all of it's records, the records cached, and then joined to the db2 data or false to indicate that the joined datasource should be queried on the fly for it's records, and then those records joined to the DB2 data.


getJoinDataSource

public DataSource getJoinDataSource()
Retrieve the joined datasource.


getJoinDataSourceAttributeNames

protected java.lang.String[] getJoinDataSourceAttributeNames()
return the datasource attribute names.


getJoinDataSourceAttributeTypes

protected AttributeType[] getJoinDataSourceAttributeTypes()
Method to return the attribute types for the data source.


readDataSource

public void readDataSource(Envelope inEnvelope)
                    throws java.lang.Exception
Read the data for the joined data source.

Throws:
java.lang.Exception

getDatasourceRecord

public Record getDatasourceRecord(java.lang.Object inKey)
Return the data source record associated with this key.


readShapes

protected abstract GISDataset readShapes(Envelope inEnvelope)
                                  throws java.lang.Exception
This method should return the shapes from the data source

Specified by:
readShapes in class SimpleDataSource
Throws:
java.lang.Exception

readEnvelope

public Envelope readEnvelope()
                      throws java.lang.Exception
Returns the bounding rectangle of all the shapes in the Data Source.

Specified by:
readEnvelope in class SimpleDataSource
Throws:
java.lang.Exception

getNode

public Node getNode()
Get the configuration information for this data source

Specified by:
getNode in interface DataSource
Overrides:
getNode in class SimpleDataSource

setNode

public void setNode(Node inNode)
             throws java.lang.Exception
Set the configuration information for this data source

Specified by:
setNode in interface DataSource
Overrides:
setNode in class SimpleDataSource
Throws:
java.lang.Exception