|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bretth.osmosis.core.pgsql.common.BaseDao
com.bretth.osmosis.core.pgsql.v0_6.impl.EntityDao<T>
T
- The entity type to be supported.public abstract class EntityDao<T extends Entity>
Provides functionality common to all top level entity daos.
Constructor Summary | |
---|---|
protected |
EntityDao(DatabaseContext dbCtx,
EntityBuilder<T> entityBuilder,
ActionDao actionDao)
Creates a new instance. |
Method Summary | |
---|---|
void |
addEntity(T entity)
Adds the specified entity to the database. |
boolean |
exists(long entityId)
Checks if the specified entity exists in the database. |
T |
getEntity(long entityId)
Loads the specified entity from the database. |
abstract ReleasableIterator<T> |
iterate()
Returns an iterator providing access to all entities in the database. |
void |
modifyEntity(T 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.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 |
---|
protected EntityDao(DatabaseContext dbCtx, EntityBuilder<T> entityBuilder, ActionDao actionDao)
dbCtx
- The database context to use for accessing the database.entityBuilder
- Provides entity type specific JDBC support.actionDao
- The dao to use for adding action records to the database.Method Detail |
---|
public boolean exists(long entityId)
entityId
- The unique identifier of the entity.
public T getEntity(long entityId)
entityId
- The unique identifier of the entity.
public void addEntity(T entity)
entity
- The entity to add.public void modifyEntity(T entity)
entity
- The entity to update.public void removeEntity(long entityId)
entityId
- The id of the entity to remove.public abstract ReleasableIterator<T> iterate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |