org.deegree.feature.persistence.sql.converter
Class FeatureParticleConverter

java.lang.Object
  extended by org.deegree.feature.persistence.sql.converter.FeatureParticleConverter
All Implemented Interfaces:
ParticleConverter<Feature>

public class FeatureParticleConverter
extends Object
implements ParticleConverter<Feature>

ParticleConverter for Feature particles.

Version:
$Revision: 30976 $, $Date: 2011-05-31 11:09:40 +0200 (Di, 31. Mai 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Constructor Summary
FeatureParticleConverter(String fkColumn, String hrefColumn, GMLReferenceResolver resolver, FeatureType valueFt, MappedAppSchema schema)
           
 
Method Summary
 String getSelectSnippet(String tableAlias)
          Returns an SQL fragment for SELECTing the particle value from the associated database table.
 String getSetSnippet(Feature particle)
          Returns a PreparedStatement fragment for setting the given particle value in an SQL statement.
 void setParticle(PreparedStatement stmt, Feature particle, int paramIndex)
          Converts the given particle and sets the designated SQL parameter in the given PreparedStatement.
 Feature toParticle(ResultSet rs, int colIndex)
          Builds a particle from the specified column of the current row of the given ResultSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureParticleConverter

public FeatureParticleConverter(String fkColumn,
                                String hrefColumn,
                                GMLReferenceResolver resolver,
                                FeatureType valueFt,
                                MappedAppSchema schema)
Method Detail

getSelectSnippet

public String getSelectSnippet(String tableAlias)
Description copied from interface: ParticleConverter
Returns an SQL fragment for SELECTing the particle value from the associated database table.

Specified by:
getSelectSnippet in interface ParticleConverter<Feature>
Parameters:
tableAlias - alias that's used for disambiguating the table, may be null
Returns:
SQL fragment (e.g. X1.columname), may be null

toParticle

public Feature toParticle(ResultSet rs,
                          int colIndex)
                   throws SQLException
Description copied from interface: ParticleConverter
Builds a particle from the specified column of the current row of the given ResultSet.

Specified by:
toParticle in interface ParticleConverter<Feature>
Parameters:
rs - result set, never null
colIndex - index of the column in the result set
Returns:
particle, may be null
Throws:
SQLException

getSetSnippet

public String getSetSnippet(Feature particle)
Description copied from interface: ParticleConverter
Returns a PreparedStatement fragment for setting the given particle value in an SQL statement.

The value may be set in a literal SQL fashion (e.g. '2007-08-09') or as a PreparedStatement placeholder ('?').

Specified by:
getSetSnippet in interface ParticleConverter<Feature>
Parameters:
particle - particle value, can be null
Returns:
SQL fragment (e.g. ?), may be null

setParticle

public void setParticle(PreparedStatement stmt,
                        Feature particle,
                        int paramIndex)
                 throws SQLException
Description copied from interface: ParticleConverter
Converts the given particle and sets the designated SQL parameter in the given PreparedStatement.

Specified by:
setParticle in interface ParticleConverter<Feature>
Parameters:
stmt - prepared statement, never null
particle - particle value, can be null
paramIndex - index of the SQL parameter in the statement
Throws:
SQLException


Copyright © 2011. All Rights Reserved.