|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.io.datastore.Datastore org.deegree.io.datastore.sql.AbstractSQLDatastore org.deegree.io.datastore.sql.oracle.OracleDatastore
public class OracleDatastore
Datastore
implementation for Oracle Spatial database systems. Supports Oracle Spatial for Oracle 10g.
TODO Which Oracle spatial versions are supported exactly?
Field Summary |
---|
Fields inherited from class org.deegree.io.datastore.sql.AbstractSQLDatastore |
---|
pool, SRS_UNDEFINED |
Constructor Summary | |
---|---|
OracleDatastore()
|
Method Summary | |
---|---|
protected java.sql.Connection |
acquireConnection()
Returns the database connection requested for. |
SQLFunctionCall |
buildSRSTransformCall(MappedGeometryPropertyType geoProperty,
java.lang.String targetSRS)
Returns an SQLFunctionCall that refers to the given MappingGeometryField in the specified target
SRS using a database specific SQL function. |
java.lang.String |
buildSRSTransformCall(java.lang.String geomIdentifier,
int nativeSRSCode)
Builds an SQL fragment that converts the given geometry to the specified SRS. |
protected boolean |
canTransformTo(java.lang.String targetSRS)
Returns whether the datastore is capable of performing a native coordinate transformation (using an SQL function call for example) into the given SRS. |
Geometry |
convertDBToDeegreeGeometry(java.lang.Object value,
CoordinateSystem targetCS,
java.sql.Connection conn)
Converts an Oracle specific geometry Object from the ResultSet to a deegree
Geometry . |
oracle.sql.STRUCT |
convertDeegreeToDBGeometry(Geometry geometry,
int nativeSRSCode,
java.sql.Connection conn)
Converts a deegree Geometry to an Oracle specific geometry object. |
java.lang.Object |
convertFromDBType(java.lang.Object rsObject,
int sqlTypeCode)
Converts the given object from a java.sql.ResultSet column to the common type to be used as a
feature property. |
static java.lang.String |
fromOracleSRIDCode(int srid)
|
int |
getNativeSRSCode(java.lang.String srsName)
Returns the database specific code for the given SRS name. |
static int |
getOracleSRIDCode(java.lang.String code)
|
java.lang.Object |
getSequenceCurrValPlusOffset(java.sql.Connection conn,
java.lang.String sequence,
int offset)
Returns the current value (plus an offset) of the given SQL sequence. |
java.lang.Object |
getSequenceNextVal(java.sql.Connection conn,
java.lang.String sequence)
Returns the next value of the given SQL sequence. |
WhereBuilder |
getWhereBuilder(MappedFeatureType[] rootFts,
java.lang.String[] aliases,
Filter filter,
SortProperty[] sortProperties,
TableAliasGenerator aliasGenerator,
VirtualContentProvider vcProvider)
Returns a specific WhereBuilder implementation for Oracle Spatial. |
java.sql.PreparedStatement |
prepareStatement(java.sql.Connection conn,
StatementBuffer statementBuffer)
Converts the StatementBuffer into a PreparedStatement , which is initialized and ready to be
performed. |
void |
releaseConnection(java.sql.Connection conn)
Releases the connection. |
protected Query |
transformQuery(Query query)
Transforms the incoming Query so that the CoordinateSystem of all spatial arguments (BBOX, etc.) |
protected FeatureCollection |
transformResult(FeatureCollection fc,
java.lang.String targetSRS)
Transforms the FeatureCollection so that the geometries of all contained geometry properties use the
requested SRS. |
Methods inherited from class org.deegree.io.datastore.sql.AbstractSQLDatastore |
---|
acquireTransaction, appendGeometryColumnGet, close, configure, createTransaction, determineFidsToLock, getAnnotationParser, getMaxValue, performQuery, performQuery, performQuery, releaseTransaction |
Methods inherited from class org.deegree.io.datastore.Datastore |
---|
bindSchema, getConfiguration, getFeatureType, getSchemas |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OracleDatastore()
Method Detail |
---|
protected java.sql.Connection acquireConnection() throws DatastoreException
acquireConnection
in class AbstractSQLDatastore
DatastoreException
public void releaseConnection(java.sql.Connection conn) throws DatastoreException
releaseConnection
in class AbstractSQLDatastore
conn
- connection to be released.
DatastoreException
public static int getOracleSRIDCode(java.lang.String code)
code
- an EPSG code
public static java.lang.String fromOracleSRIDCode(int srid)
srid
-
public WhereBuilder getWhereBuilder(MappedFeatureType[] rootFts, java.lang.String[] aliases, Filter filter, SortProperty[] sortProperties, TableAliasGenerator aliasGenerator, VirtualContentProvider vcProvider) throws DatastoreException
WhereBuilder
implementation for Oracle Spatial.
getWhereBuilder
in class AbstractSQLDatastore
rootFts
- involved (requested) feature typesaliases
- aliases for the feature types, may be nullfilter
- filter that restricts the matched featuressortProperties
- sort criteria for the result, may be null or emptyaliasGenerator
- used to generate unique table aliasesvcProvider
-
WhereBuilder
implementation for Oracle Spatial
DatastoreException
public Geometry convertDBToDeegreeGeometry(java.lang.Object value, CoordinateSystem targetCS, java.sql.Connection conn) throws java.sql.SQLException
Object
from the ResultSet
to a deegree
Geometry
.
convertDBToDeegreeGeometry
in class AbstractSQLDatastore
value
- targetCS
- conn
-
java.sql.SQLException
public oracle.sql.STRUCT convertDeegreeToDBGeometry(Geometry geometry, int nativeSRSCode, java.sql.Connection conn) throws DatastoreException
Geometry
to an Oracle specific geometry object.
convertDeegreeToDBGeometry
in class AbstractSQLDatastore
geometry
- nativeSRSCode
- conn
-
DatastoreException
public java.lang.Object convertFromDBType(java.lang.Object rsObject, int sqlTypeCode) throws DatastoreException
java.sql.ResultSet
column to the common type to be used as a
feature property.
NOTE: String- and boolean-valued results have a special conversion handling:
Strings:
because we encountered difficulties when inserting empty strings "" into String-type
columns with NOT NULL constraints (for example in VARCHAR2 fields), "$EMPTY_STRING$" is used to mark them.Boolean:because Oracle has no special boolean type, it is assumed that a CHAR(1) column is used
instead (with values 'Y'=true and 'N'=false)
convertFromDBType
in class AbstractSQLDatastore
rsObject
- sqlTypeCode
-
DatastoreException
public java.lang.Object getSequenceNextVal(java.sql.Connection conn, java.lang.String sequence) throws DatastoreException
getSequenceNextVal
in class AbstractSQLDatastore
conn
- JDBC connection to be used.sequence
- name of the SQL sequence
DatastoreException
- if the value could not be retrievedpublic java.lang.Object getSequenceCurrValPlusOffset(java.sql.Connection conn, java.lang.String sequence, int offset) throws DatastoreException
getSequenceCurrValPlusOffset
in class AbstractSQLDatastore
conn
- JDBC connection to be used.sequence
- name of the SQL sequenceoffset
- offset added to the sequence value
DatastoreException
- if the value could not be retrievedpublic java.sql.PreparedStatement prepareStatement(java.sql.Connection conn, StatementBuffer statementBuffer) throws java.sql.SQLException
StatementBuffer
into a PreparedStatement
, which is initialized and ready to be
performed.
TODO remove this method (use super class method instead), change handling of JGeometry NOTE: String- and
boolean-valued results have a special conversion handling:
Strings:
because we encountered difficulties when inserting empty strings "" into String-type
columns with NOT NULL constraints (for example in VARCHAR2 fields), "$EMPTY_STRING$" is used to mark them.Boolean:because Oracle has no special boolean type, it is assumed that a CHAR(1) column is used
instead (with values 'Y'=true and 'N'=false)
prepareStatement
in class AbstractSQLDatastore
conn
- connection to be used to create the PreparedStatement
statementBuffer
-
PreparedStatment
, ready to be performed
java.sql.SQLException
- if a JDBC related error occursprotected Query transformQuery(Query query)
Query
so that the CoordinateSystem
of all spatial arguments (BBOX, etc.)
in the Filter
match the SRS of the targeted MappingGeometryField
s.
NOTE: If this transformation can be performed by the backend (e.g. by Oracle Spatial), this method should be
overwritten to return the original input Query
.
transformQuery
in class Datastore
query
- query to be transformed
protected FeatureCollection transformResult(FeatureCollection fc, java.lang.String targetSRS)
FeatureCollection
so that the geometries of all contained geometry properties use the
requested SRS.
transformResult
in class Datastore
fc
- feature collection to be transformedtargetSRS
- requested SRS
protected boolean canTransformTo(java.lang.String targetSRS)
canTransformTo
in class Datastore
targetSRS
- target spatial reference system (usually "EPSG:XYZ")
public SQLFunctionCall buildSRSTransformCall(MappedGeometryPropertyType geoProperty, java.lang.String targetSRS) throws DatastoreException
SQLFunctionCall
that refers to the given MappingGeometryField
in the specified target
SRS using a database specific SQL function.
buildSRSTransformCall
in class AbstractSQLDatastore
geoProperty
- geometry propertytargetSRS
- target spatial reference system (usually "EPSG:XYZ")
SQLFunctionCall
that refers to the geometry in the specified srs
DatastoreException
public java.lang.String buildSRSTransformCall(java.lang.String geomIdentifier, int nativeSRSCode) throws DatastoreException
AbstractSQLDatastore
buildSRSTransformCall
in class AbstractSQLDatastore
DatastoreException
public int getNativeSRSCode(java.lang.String srsName)
AbstractSQLDatastore
getNativeSRSCode
in class AbstractSQLDatastore
srsName
- spatial reference system name (usually "EPSG:XYZ")
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org