|
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.sql.AbstractRequestHandler
public class AbstractRequestHandler
This abstract class implements some common SQL functionality needed by request handlers for SQL based datastores.
QueryHandler
Field Summary | |
---|---|
protected TableAliasGenerator |
aliasGenerator
|
protected java.sql.Connection |
conn
|
protected AbstractSQLDatastore |
datastore
|
protected static java.lang.String |
FT_COLUMN
Column used for disambiguation of feature properties that contain features that have more than one concrete type. |
protected static java.lang.String |
FT_PREFIX
Column prefix used for disambiguation of feature properties that contain features that have more than one concrete type. |
Constructor Summary | |
---|---|
AbstractRequestHandler(AbstractSQLDatastore ds,
TableAliasGenerator aliasGenerator,
java.sql.Connection conn)
Creates a new instance of AbstractRequestHandler from the given parameters. |
Method Summary | |
---|---|
void |
appendColumnsList(StatementBuffer query,
java.lang.String[] columns)
Appends the specified columns as a comma-separated list to the given query. |
protected void |
appendFeatureIdColumns(MappedFeatureType featureType,
java.lang.String tableAlias,
StatementBuffer query)
Appends the alias qualified columns that make up the feature id to the given query. |
protected void |
appendFeatureIdConstraint(StatementBuffer query,
FeatureId fid)
|
protected void |
appendFeatureIdConstraint(StatementBuffer query,
FeatureId fid,
java.lang.String tableAlias)
|
protected void |
appendJoinCondition(TableRelation tableRelation,
java.lang.String fromAlias,
java.lang.String toAlias,
StatementBuffer query)
|
protected void |
appendJoins(TableRelation[] tableRelation,
java.lang.String fromAlias,
java.lang.String[] toAliases,
StatementBuffer query)
|
void |
appendQualifiedColumn(StatementBuffer query,
java.lang.String tableAlias,
java.lang.String column)
Appends the specified column to the given query. |
void |
appendQualifiedColumnsList(StatementBuffer query,
java.lang.String tableAlias,
java.lang.String[] columns)
Appends the specified columns as alias-qualified, comma-separated list to the given query. |
java.util.List<FeatureId> |
determineAffectedAndModifiableFIDs(MappedFeatureType ft,
Filter filter,
java.lang.String lockId)
Determines the feature ids that are matched by the given filter and that are either not locked or locked by the specified lockId. |
java.util.List<FeatureId> |
determineAffectedFIDs(MappedFeatureType ft,
Filter filter)
Determines the feature ids that are matched by the given filter. |
java.util.Map<MappedFeaturePropertyType,java.util.List<FeatureId>> |
determineSubFeatures(FeatureId fid)
Determines all complex properties and contained subfeature ids for a certain feature. |
java.util.Set<FeatureId> |
determineSuperFeatures(FeatureId fid)
Determines all super features (as FeatureId instances) for a certain feature. |
protected FeatureId |
extractFeatureId(java.sql.ResultSet rs,
MappedFeatureType ft)
Extracts the FeatureId in the current row of the given ResultSet . |
protected java.util.List<FeatureId> |
extractFeatureIds(java.sql.ResultSet rs,
MappedFeatureType ft)
Extracts the feature ids in the given ResultSet as a List of FeatureIds. |
protected java.util.List<FeatureId> |
extractFeatureIdsForceUnique(java.sql.ResultSet rs,
MappedFeatureType ft)
Extracts the feature ids in the given ResultSet as a List of FeatureIds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String FT_COLUMN
protected static final java.lang.String FT_PREFIX
protected AbstractSQLDatastore datastore
protected TableAliasGenerator aliasGenerator
protected java.sql.Connection conn
Constructor Detail |
---|
public AbstractRequestHandler(AbstractSQLDatastore ds, TableAliasGenerator aliasGenerator, java.sql.Connection conn)
AbstractRequestHandler
from the given parameters.
ds
- aliasGenerator
- conn
- Method Detail |
---|
public java.util.List<FeatureId> determineAffectedFIDs(MappedFeatureType ft, Filter filter) throws DatastoreException
ft
- non-abstract feature typefilter
- constraints the feature instances
DatastoreException
public java.util.List<FeatureId> determineAffectedAndModifiableFIDs(MappedFeatureType ft, Filter filter, java.lang.String lockId) throws DatastoreException
ft
- non-abstract feature typefilter
- constraints the feature instanceslockId
- optional id of associated lock (may be null)
DatastoreException
public java.util.Map<MappedFeaturePropertyType,java.util.List<FeatureId>> determineSubFeatures(FeatureId fid) throws DatastoreException
fid
- id of the feature
DatastoreException
public java.util.Set<FeatureId> determineSuperFeatures(FeatureId fid) throws DatastoreException
FeatureId
instances) for a certain feature.
fid
- id of the feature
DatastoreException
protected void appendFeatureIdColumns(MappedFeatureType featureType, java.lang.String tableAlias, StatementBuffer query)
featureType
- tableAlias
- query
- protected FeatureId extractFeatureId(java.sql.ResultSet rs, MappedFeatureType ft) throws java.sql.SQLException, DatastoreException
ResultSet
.
rs
- ft
- feature type (may not be abstract)
java.sql.SQLException
DatastoreException
protected java.util.List<FeatureId> extractFeatureIdsForceUnique(java.sql.ResultSet rs, MappedFeatureType ft) throws java.sql.SQLException, DatastoreException
ResultSet
as a List of FeatureIds.
If the given feature type is abstract, it is expected that the first column of the result set contains the local name of the feature type.
rs
- ft
- feature type
java.sql.SQLException
DatastoreException
protected java.util.List<FeatureId> extractFeatureIds(java.sql.ResultSet rs, MappedFeatureType ft) throws java.sql.SQLException, DatastoreException
ResultSet
as a List of FeatureIds.
If the given feature type is abstract, it is expected that the first column of the result set contains the local name of the feature type.
rs
- ft
- feature type (may be abstract)
java.sql.SQLException
DatastoreException
protected void appendJoins(TableRelation[] tableRelation, java.lang.String fromAlias, java.lang.String[] toAliases, StatementBuffer query)
protected void appendJoinCondition(TableRelation tableRelation, java.lang.String fromAlias, java.lang.String toAlias, StatementBuffer query)
protected void appendFeatureIdConstraint(StatementBuffer query, FeatureId fid)
protected void appendFeatureIdConstraint(StatementBuffer query, FeatureId fid, java.lang.String tableAlias)
public void appendColumnsList(StatementBuffer query, java.lang.String[] columns)
query
- StatementBuffer that the list is appended tocolumns
- array of column namespublic void appendQualifiedColumnsList(StatementBuffer query, java.lang.String tableAlias, java.lang.String[] columns)
query
- StatementBuffer that the list is appended totableAlias
- alias to use as qualifier (alias.field)columns
- array of column namespublic void appendQualifiedColumn(StatementBuffer query, java.lang.String tableAlias, java.lang.String column)
query
- StatementBuffer that the list is appended totableAlias
- alias to use as qualifier (alias.field)column
- column name
|
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