com.bretth.osmosis.core.pgsql.v0_6.impl
Class WayBuilder

java.lang.Object
  extended by com.bretth.osmosis.core.pgsql.v0_6.impl.EntityBuilder<Way>
      extended by com.bretth.osmosis.core.pgsql.v0_6.impl.WayBuilder

public class WayBuilder
extends EntityBuilder<Way>

Reads and writes way attributes to jdbc classes.

Author:
Brett Henderson

Constructor Summary
WayBuilder()
          Creates a new instance.
WayBuilder(boolean supportBboxColumn, boolean supportLinestringColumn)
          Creates a new instance.
 
Method Summary
 Way buildEntity(java.sql.ResultSet resultSet)
          Creates a new entity based upon the current row in the result set.
 java.lang.Class<Way> getEntityClass()
          Returns the class for the entity type being supported.
 java.lang.String getEntityName()
          Returns the name of the entity to substitute into SQL statements.
 ActionDataType getEntityType()
          Returns the action data type of the entity.
protected  java.lang.String[] getTypeSpecificFieldNames()
          Produces an array of additional column names specific to this entity type to be returned by entity queries.
 int populateEntityParameters(java.sql.PreparedStatement statement, int initialIndex, Way way)
          Sets entity values as bind variable parameters to an entity insert query.
 int populateEntityParameters(java.sql.PreparedStatement statement, int initialIndex, Way way, java.util.List<org.postgis.Geometry> geometries)
          Sets entity values as bind variable parameters to an entity insert query.
 
Methods inherited from class com.bretth.osmosis.core.pgsql.v0_6.impl.EntityBuilder
buildUser, getSqlDelete, getSqlInsert, getSqlSelect, getSqlSelectCount, getSqlUpdate, populateCommonEntityParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WayBuilder

public WayBuilder()
Creates a new instance.


WayBuilder

public WayBuilder(boolean supportBboxColumn,
                  boolean supportLinestringColumn)
Creates a new instance.

Parameters:
supportBboxColumn - If true, the bounding box column will be included in updates.
supportLinestringColumn - If true, the linestring column will be included in updates.
Method Detail

getEntityName

public java.lang.String getEntityName()
Returns the name of the entity to substitute into SQL statements. This is a low-tech way of making the queries type independent.

Specified by:
getEntityName in class EntityBuilder<Way>
Returns:
The entity name as defined in the database schema.

getEntityType

public ActionDataType getEntityType()
Returns the action data type of the entity.

Specified by:
getEntityType in class EntityBuilder<Way>
Returns:
The action type.

getEntityClass

public java.lang.Class<Way> getEntityClass()
Returns the class for the entity type being supported.

Specified by:
getEntityClass in class EntityBuilder<Way>
Returns:
The entity type class.

getTypeSpecificFieldNames

protected java.lang.String[] getTypeSpecificFieldNames()
Produces an array of additional column names specific to this entity type to be returned by entity queries.

Specified by:
getTypeSpecificFieldNames in class EntityBuilder<Way>
Returns:
The column names.

buildEntity

public Way buildEntity(java.sql.ResultSet resultSet)
Creates a new entity based upon the current row in the result set.

Specified by:
buildEntity in class EntityBuilder<Way>
Parameters:
resultSet - The result set to read from.
Returns:
The newly built entity object.

populateEntityParameters

public int populateEntityParameters(java.sql.PreparedStatement statement,
                                    int initialIndex,
                                    Way way)
Sets entity values as bind variable parameters to an entity insert query.

Specified by:
populateEntityParameters in class EntityBuilder<Way>
Parameters:
statement - The prepared statement to add the values to.
initialIndex - The offset index of the first variable to set.
way - The entity containing the data to be inserted.
Returns:
The current parameter offset.

populateEntityParameters

public int populateEntityParameters(java.sql.PreparedStatement statement,
                                    int initialIndex,
                                    Way way,
                                    java.util.List<org.postgis.Geometry> geometries)
Sets entity values as bind variable parameters to an entity insert query.

Parameters:
statement - The prepared statement to add the values to.
initialIndex - The offset index of the first variable to set.
way - The entity containing the data to be inserted.
geometries - The geometries to store against the way.
Returns:
The current parameter offset.