deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.io.datastore.sql.generic
Class GenericSQLDatastore

java.lang.Object
  extended by org.deegree.io.datastore.Datastore
      extended by org.deegree.io.datastore.sql.AbstractSQLDatastore
          extended by org.deegree.io.datastore.sql.generic.GenericSQLDatastore

public class GenericSQLDatastore
extends AbstractSQLDatastore

Datastore implementation for any SQL database that can be accessed through a jdbc connection (even the odbc-jdbc bridge is supported) and that supports the storing of BLOBs.

The spatial information is assumed to be stored in a BLOB field as a serialized deegree geometry. It also will be assumed that a spatial index exists and that it has been created using deegree's quadtree api.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $
See Also:
org.deegree.io.quadtree

Field Summary
 
Fields inherited from class org.deegree.io.datastore.sql.AbstractSQLDatastore
pool, SRS_UNDEFINED
 
Constructor Summary
GenericSQLDatastore()
           
 
Method Summary
 Geometry convertDBToDeegreeGeometry(Object value, CoordinateSystem targetCS, Connection conn)
          Converts a database specific geometry Object from the ResultSet to a deegree Geometry.
 Object convertDeegreeToDBGeometry(Geometry geometry, int nativeSRSCode, Connection conn)
          Converts a deegree Geometry to a database specific geometry Object.
protected  GenericSQLTransaction createTransaction()
          Creates a new SQLTransaction that provides transactional access.
 WhereBuilder getWhereBuilder(MappedFeatureType[] rootFts, String[] aliases, Filter filter, SortProperty[] sortProperties, TableAliasGenerator aliasGenerator, VirtualContentProvider vcProvider)
          Overwrite this to return a database specific (spatial capable) WhereBuilder implementation.
protected  FeatureCollection performQuery(Query query, MappedFeatureType[] rootFts, Connection conn)
          Performs a Query against the datastore.
 
Methods inherited from class org.deegree.io.datastore.sql.AbstractSQLDatastore
acquireConnection, acquireTransaction, appendGeometryColumnGet, buildSRSTransformCall, buildSRSTransformCall, close, configure, convertFromDBType, determineFidsToLock, getAnnotationParser, getMaxValue, getNativeSRSCode, getSequenceCurrValPlusOffset, getSequenceNextVal, performQuery, performQuery, prepareStatement, releaseConnection, releaseTransaction
 
Methods inherited from class org.deegree.io.datastore.Datastore
bindSchema, canTransformTo, getConfiguration, getFeatureType, getSchemas, transformQuery, transformResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericSQLDatastore

public GenericSQLDatastore()
Method Detail

getWhereBuilder

public WhereBuilder getWhereBuilder(MappedFeatureType[] rootFts,
                                    String[] aliases,
                                    Filter filter,
                                    SortProperty[] sortProperties,
                                    TableAliasGenerator aliasGenerator,
                                    VirtualContentProvider vcProvider)
                             throws DatastoreException
Description copied from class: AbstractSQLDatastore
Overwrite this to return a database specific (spatial capable) WhereBuilder implementation.

Overrides:
getWhereBuilder in class AbstractSQLDatastore
Parameters:
rootFts - involved (requested) feature types
aliases - aliases for the feature types, may be null
filter - filter that restricts the matched features
sortProperties - sort criteria for the result, may be null or empty
aliasGenerator - used to generate unique table aliases
Returns:
WhereBuilder implementation suitable for this datastore
Throws:
DatastoreException

performQuery

protected FeatureCollection performQuery(Query query,
                                         MappedFeatureType[] rootFts,
                                         Connection conn)
                                  throws DatastoreException
Description copied from class: AbstractSQLDatastore
Performs a Query against the datastore.

Note that this method is responsible for the coordinate system tranformation of the input Query and the output FeatureCollection.

Overrides:
performQuery in class AbstractSQLDatastore
Parameters:
query - query to be performed
rootFts - the root feature types that are queried, more than one type means that the types are joined
conn - JDBC connection to use
Returns:
requested feature instances
Throws:
DatastoreException

convertDBToDeegreeGeometry

public Geometry convertDBToDeegreeGeometry(Object value,
                                           CoordinateSystem targetCS,
                                           Connection conn)
                                    throws SQLException
Description copied from class: AbstractSQLDatastore
Converts a database specific geometry Object from the ResultSet to a deegree Geometry.

Specified by:
convertDBToDeegreeGeometry in class AbstractSQLDatastore
Returns:
corresponding deegree geometry
Throws:
SQLException

convertDeegreeToDBGeometry

public Object convertDeegreeToDBGeometry(Geometry geometry,
                                         int nativeSRSCode,
                                         Connection conn)
                                  throws DatastoreException
Description copied from class: AbstractSQLDatastore
Converts a deegree Geometry to a database specific geometry Object.

Specified by:
convertDeegreeToDBGeometry in class AbstractSQLDatastore
Returns:
corresponding database specific geometry object
Throws:
DatastoreException

createTransaction

protected GenericSQLTransaction createTransaction()
                                           throws DatastoreException
Description copied from class: AbstractSQLDatastore
Creates a new SQLTransaction that provides transactional access.

Overrides:
createTransaction in class AbstractSQLDatastore
Returns:
new SQLTransaction instance
Throws:
DatastoreException

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org