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

java.lang.Object
  extended by com.bretth.osmosis.core.pgsql.common.BaseDao
      extended by com.bretth.osmosis.core.pgsql.v0_6.impl.EntityDao<Relation>
          extended by com.bretth.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.
 Relation getEntity(long entityId)
          Loads the specified entity from the database.
 ReleasableIterator<Relation> iterate()
          Returns an iterator providing access to all entities in the database.
 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 com.bretth.osmosis.core.pgsql.v0_6.impl.EntityDao
exists
 
Methods inherited from class com.bretth.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

getEntity

public Relation getEntity(long entityId)
Loads the specified entity from the database.

Overrides:
getEntity in class EntityDao<Relation>
Parameters:
entityId - The unique identifier of the entity.
Returns:
The loaded entity.

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.