org.openstreetmap.osmosis.core.pgsql.v0_5.impl
Class EntityTagTableReader

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pgsql.common.BaseTableReader<DBEntityTag>
      extended by org.openstreetmap.osmosis.core.pgsql.v0_5.impl.EntityTagTableReader
All Implemented Interfaces:
java.util.Iterator<DBEntityTag>, Releasable, ReleasableIterator<DBEntityTag>

public class EntityTagTableReader
extends BaseTableReader<DBEntityTag>

Reads all tags for an entity from a tag table ordered by the entity identifier. This relies on the fact that all tag tables have an identical layout.

Author:
Brett Henderson

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openstreetmap.osmosis.core.pgsql.common.BaseTableReader
BaseTableReader.ReadResult<T>
 
Constructor Summary
EntityTagTableReader(DatabaseContext dbCtx, java.lang.String tableName, java.lang.String idColumnName)
          Creates a new instance.
EntityTagTableReader(DatabaseContext dbCtx, java.lang.String tableName, java.lang.String idColumnName, java.lang.String constraintTable)
          Creates a new instance.
 
Method Summary
protected  BaseTableReader.ReadResult<DBEntityTag> createNextValue(java.sql.ResultSet resultSet)
          Builds an entity object from the current recordset row.
protected  java.sql.ResultSet createResultSet(DatabaseContext queryDbCtx)
          Builds the result set that the reader will iterate over.
 
Methods inherited from class org.openstreetmap.osmosis.core.pgsql.common.BaseTableReader
createLastValue, hasNext, next, release, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityTagTableReader

public EntityTagTableReader(DatabaseContext dbCtx,
                            java.lang.String tableName,
                            java.lang.String idColumnName)
Creates a new instance.

Parameters:
dbCtx - The active connection to use for reading from the database.
tableName - The name of the table to query tag information from.
idColumnName - The name of the column containing the entity id.

EntityTagTableReader

public EntityTagTableReader(DatabaseContext dbCtx,
                            java.lang.String tableName,
                            java.lang.String idColumnName,
                            java.lang.String constraintTable)
Creates a new instance.

Parameters:
dbCtx - The active connection to use for reading from the database.
tableName - The name of the table to query tag information from.
idColumnName - The name of the column containing the entity id.
constraintTable - The table containing a column named id defining the list of entities to be returned.
Method Detail

createResultSet

protected java.sql.ResultSet createResultSet(DatabaseContext queryDbCtx)
Builds the result set that the reader will iterate over.

Specified by:
createResultSet in class BaseTableReader<DBEntityTag>
Parameters:
queryDbCtx - The database context to query against.
Returns:
A result set positioned before the first record.

createNextValue

protected BaseTableReader.ReadResult<DBEntityTag> createNextValue(java.sql.ResultSet resultSet)
Builds an entity object from the current recordset row.

Specified by:
createNextValue in class BaseTableReader<DBEntityTag>
Parameters:
resultSet - The record set to retrieve the data from.
Returns:
The result of the read.