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

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pgsql.common.BaseDao
      extended by org.openstreetmap.osmosis.core.pgsql.v0_6.impl.EntityDao<Relation>
          extended by org.openstreetmap.osmosis.core.pgsql.v0_6.impl.RelationDao
All Implemented Interfaces:
Releasable

public class RelationDao
extends EntityDao<Relation>

Performs all relation-specific db operations.

Author:
Brett Henderson

Constructor Summary
RelationDao(DatabaseContext dbCtx, ActionDao actionDao)
          Creates a new instance.
 
Method Summary
 void addEntity(Relation entity)
          Adds the specified entity to the database.
 ReleasableIterator<Relation> iterate()
          Returns an iterator providing access to all entities in the database.
protected  void loadFeatures(long entityId, Relation entity)
          Adds the type specific features to the entity.
 void modifyEntity(Relation entity)
          Updates the specified entity details in the database.
 void removeEntity(long entityId)
          Removes the specified entity from the database.
 
Methods inherited from class org.openstreetmap.osmosis.core.pgsql.v0_6.impl.EntityDao
exists, getEntity
 
Methods inherited from class org.openstreetmap.osmosis.core.pgsql.common.BaseDao
getDatabaseContext, prepareStatement, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationDao

public RelationDao(DatabaseContext dbCtx,
                   ActionDao actionDao)
Creates a new instance.

Parameters:
dbCtx - The database context to use for accessing the database.
actionDao - The dao to use for adding action records to the database.
Method Detail

loadFeatures

protected void loadFeatures(long entityId,
                            Relation entity)
Adds the type specific features to the entity.

Specified by:
loadFeatures in class EntityDao<Relation>
Parameters:
entityId - The entity id.
entity - The entity requiring features to be added.

addEntity

public void addEntity(Relation entity)
Adds the specified entity to the database.

Overrides:
addEntity in class EntityDao<Relation>
Parameters:
entity - The entity to add.

modifyEntity

public void modifyEntity(Relation entity)
Updates the specified entity details in the database.

Overrides:
modifyEntity in class EntityDao<Relation>
Parameters:
entity - The entity to update.

removeEntity

public void removeEntity(long entityId)
Removes the specified entity from the database.

Overrides:
removeEntity in class EntityDao<Relation>
Parameters:
entityId - The id of the entity to remove.

iterate

public ReleasableIterator<Relation> iterate()
Returns an iterator providing access to all entities in the database.

Specified by:
iterate in class EntityDao<Relation>
Returns:
The entity iterator.