org.openstreetmap.osmosis.core.pgsql.v0_6.impl
Class RelationMapper

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pgsql.v0_6.impl.EntityMapper<Relation>
      extended by org.openstreetmap.osmosis.core.pgsql.v0_6.impl.RelationMapper

public class RelationMapper
extends EntityMapper<Relation>

Reads and writes relation attributes to jdbc classes.

Author:
Brett Henderson

Constructor Summary
RelationMapper()
           
 
Method Summary
 java.lang.Class<Relation> getEntityClass()
          Returns the class type for the entity.
 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.
 Relation parseRecord(java.sql.ResultSet resultSet)
          Creates a new entity based upon the current row in the result set.
 int populateEntityParameters(java.sql.PreparedStatement statement, int initialIndex, Relation relation)
          Sets entity values as bind variable parameters to an entity insert query.
 
Methods inherited from class org.openstreetmap.osmosis.core.pgsql.v0_6.impl.EntityMapper
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

RelationMapper

public RelationMapper()
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 EntityMapper<Relation>
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 EntityMapper<Relation>
Returns:
The action type.

getEntityClass

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

Specified by:
getEntityClass in class EntityMapper<Relation>
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 EntityMapper<Relation>
Returns:
The column names.

parseRecord

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

Specified by:
parseRecord in class EntityMapper<Relation>
Parameters:
resultSet - The result set to read from.
Returns:
The newly built entity object.

populateEntityParameters

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

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